import React, { ReactNode } from "react"; import { CommonComponentProps, Classes } from "./common"; import styled from "styled-components"; import Icon, { IconName, IconSize } from "./Icon"; import Text, { TextType, FontWeight } from "./Text"; type MenuItemProps = CommonComponentProps & { icon?: IconName; text: string; label?: ReactNode; onSelect?: () => void; }; const ItemRow = styled.div` display: flex; align-items: center; justify-content: space-between; padding: ${props => props.theme.spaces[4]}px ${props => props.theme.spaces[6]}px; &:hover { cursor: pointer; background-color: ${props => props.theme.colors.blackShades[4]}; .${Classes.TEXT} { color: ${props => props.theme.colors.blackShades[9]}; } .${Classes.ICON} { path { fill: ${props => props.theme.colors.blackShades[9]}; } } } `; const IconContainer = styled.div` display: flex; align-items: center; .${Classes.ICON} { margin-right: ${props => props.theme.spaces[5]}px; } `; function MenuItem(props: MenuItemProps) { return ( {props.icon ? : null} {props.text ? ( {props.text} ) : null} {props.label ? {props.label} : null} ); } export default MenuItem;