Files
web/packages/design-system/lib/components/Icons/MaterialIcon/MaterialIcon.tsx
Erik Tiekstra f62723c6e5 feat(SW-2178): Changed to new buttons for summary inside enter details
Approved-by: Michael Zetterberg
Approved-by: Matilda Landström
2025-04-11 15:13:37 +00:00

36 lines
893 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,
size = 24,
className,
isFilled = false,
...props
}: MaterialIconProps) {
const classNames = iconVariants({ className, color })
return (
// The span is used to prevent the MaterialSymbol from being underlined when used inside a link or button
<span>
<MaterialSymbol
className={classNames}
size={size}
{...props}
fill={isFilled}
/>
</span>
)
}