Files
web/packages/design-system/lib/components/Icons/MaterialIcon/MaterialIcon.tsx
2025-04-07 12:17:35 +02:00

25 lines
685 B
TypeScript

import {
MaterialSymbol,
type MaterialSymbolProps,
} from 'react-material-symbols'
import { iconVariants } from '../variants'
import type { VariantProps } from 'class-variance-authority'
export interface MaterialIconProps
extends Pick<MaterialSymbolProps, 'size' | 'icon' | 'className' | 'style'>,
VariantProps<typeof iconVariants> {
isFilled?: boolean
}
export type MaterialIconSetIconProps = Omit<MaterialIconProps, 'icon'>
export function MaterialIcon({
color,
className,
isFilled = false,
...props
}: MaterialIconProps) {
const classNames = iconVariants({ className, color })
return <MaterialSymbol className={classNames} {...props} fill={isFilled} />
}