The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/components/Message/Actions/Actions.tsx

34 lines
905 B

import { IconProps, ButtonGroup } from '@rocket.chat/fuselage';
import React, { FC } from 'react';
import { TranslationKey } from '../../../contexts/TranslationContext';
import Content from '../Metrics/Content';
import Action from './Action';
type RunAction = () => void;
type ActionOptions = {
mid: string;
id: string;
icon: IconProps['name'];
i18nLabel?: TranslationKey;
label?: string;
runAction?: RunAction;
actionLinksAlignment?: string;
};
const Actions: FC<{ actions: Array<ActionOptions>; runAction: RunAction; mid: string }> = ({ actions, runAction }) => {
const alignment = actions[0]?.actionLinksAlignment || 'center';
return (
<Content width='full' justifyContent={alignment}>
<ButtonGroup align='center'>
{actions.map((action) => (
<Action runAction={runAction} key={action.id} {...action} />
))}
</ButtonGroup>
</Content>
);
};
export default Actions;