2025-06-26 15:12:34 +08:00

24 lines
471 B
TypeScript

export default function svgIcon({
name,
prefix = 'icon',
color = '#333',
width = '16px',
height = '16px',
...props
}: {
name: string;
prefix?: string;
color?: string;
width?: string;
height?: string;
[key: string]: any;
}) {
const symbolId = `#${prefix}-${name}`
return (
<svg {...props} aria-hidden="true" style={{ width, height }}>
<use href={symbolId} fill={color} />
</svg>
)
}