RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfoActions.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import type { Keys as IconKeys } from '@rocket.chat/icons';
import React from 'react';

import { InfoPanelAction } from '../../../../../components/InfoPanel';

type Action = {
    id: string;
    content: string;
    icon: IconKeys;
    onClick: () => void;
    variant?: string;
};

export type RoomInfoActionsProps = {
    actions: { items: Action[] };
    className?: string;
};

const RoomInfoActions = ({ actions, className }: RoomInfoActionsProps) => {
    return (
        <>
            {actions.items.map(({ id, content, icon, onClick }) => (
                <InfoPanelAction className={className} key={id} label={content} onClick={onClick} icon={icon} />
            ))}
        </>
    );
};

export default RoomInfoActions;