25 lines
685 B
TypeScript
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} />
|
|
}
|