import React from 'react' const statusTypes = { default: 'bg-inverted-2', success: 'bg-success', warning: 'bg-warning', danger: 'bg-danger', dangerLight: 'bg-danger-light', } const DescriptionComponent = ({ description, inverted, }: Pick) => (description && ( {description} )) || null const StatusComponent = ({ type = 'default', description, inverted = false, }: StatusProps) => { return (
{inverted && ( )} {!inverted && ( )}
) } export const Status = React.memo(StatusComponent) export interface StatusProps { /** Status color * @default default * */ type: keyof typeof statusTypes /** * Status additional text * */ description?: string /** Invert icon and text position * @default false * */ inverted?: boolean }