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/Sidebar/ListItem.tsx

19 lines
580 B

import { Option, OptionColumn } from '@rocket.chat/fuselage';
import React, { ComponentProps, MouseEventHandler, ReactElement } from 'react';
type ListItemProps = {
text: string;
icon?: ComponentProps<typeof Option.Icon>['name'];
input?: any;
action?: MouseEventHandler<HTMLOrSVGElement>;
};
const ListItem = ({ text, icon, input, action }: ListItemProps): ReactElement => (
<Option onClick={action}>
{icon && <Option.Icon name={icon} />}
<Option.Content>{text}</Option.Content>
{input && <OptionColumn>{input}</OptionColumn>}
</Option>
);
export default ListItem;