import { forwardRef } from 'react'; import Box from '@mui/material/Box'; import { useTheme } from '@mui/material/styles'; import { StyledLabel } from './styles'; import { labelClasses } from './classes'; import type { LabelProps } from './types'; // ---------------------------------------------------------------------- export const Label = forwardRef( ( { children, color = 'default', variant = 'soft', startIcon, endIcon, sx, className, ...other }, ref ) => { const theme = useTheme(); const iconStyles = { width: 16, height: 16, '& svg, img': { width: 1, height: 1, objectFit: 'cover', }, }; return ( {startIcon && ( {startIcon} )} {typeof children === 'string' ? sentenceCase(children) : children} {endIcon && ( {endIcon} )} ); } ); // ---------------------------------------------------------------------- function sentenceCase(string: string): string { return string.charAt(0).toUpperCase() + string.slice(1); }