import { Center, CenterProps, ComponentWithAs, forwardRef, useBreakpointValue, useColorMode, } from '@chakra-ui/react'; import { theme } from '../../modules/theme'; import { STATUSES_TO_COLOR_SCHEME, STATUSES_TO_ICON, Status } from '../internal/Status'; type Props = CenterProps & { size?: CenterProps['w']; status: Status; }; export const IconStatus: ComponentWithAs<'div', Props> = forwardRef( ({ size: responsiveSize = theme.sizes['4'], status, ...props }, ref) => { const { colorMode } = useColorMode(); const size = useBreakpointValue(responsiveSize as any) ?? responsiveSize; return (
{STATUSES_TO_ICON[status as keyof typeof STATUSES_TO_ICON]}
); }, );