I put together the code snippet below, and I'm trying to define a specific type for the custom iconFontSize
prop. Can someone guide me on how to achieve this?
import { SvgIconComponent } from '@mui/icons-material'
import { Typography, TypographyProps} from '@mui/material'
type Props = TypographyProps & {
Icon: SvgIconComponent
iconFontSize: /* need help defining type here! */
}
export const IconTypography = ({
Icon,
iconFontSize = 'inherit',
columnGap = 1,
children,
...props
}: Props) => {
return (
<Typography display="flex" alignItems="center" columnGap={columnGap} {...props}>
<Icon fontSize={iconFontSize} />
{children}
</Typography>
)
}
Appreciate any assistance you can provide!