import styled, { css } from 'styled-components'; import { Flex, Row, Text, Icon, TextProps } from '../../../general'; import { IconPathsType } from '../../general/Icon/icons'; export type MenuItemProps = { id?: string; icon?: IconPathsType; iconColor?: string; label: string; labelColor?: string; backgroundColor?: string; disabled?: boolean; section?: number; onClick: ( evt: React.MouseEvent, elem?: HTMLElement ) => void; }; type MenuItemLabelProps = { labelColor?: string; } & TextProps; const MenuItemLabel = styled(Text.Custom)` ${(props) => props.labelColor && css` color: ${props.labelColor || 'inherit'}; `} `; export const MenuItem = ({ id, icon, label, disabled, iconColor, labelColor, backgroundColor, onClick, }: MenuItemProps) => { return ( !disabled && onClick(evt as React.MouseEvent) } > {icon && ( )} {label} ); };