24 lines
471 B
TypeScript
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>
|
|
)
|
|
}
|