blob: 560fb6db4cf63e3d9a12be1067a19c7fd04840a6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import cx from 'clsx';
import React from 'react';
type Props = {
id: string;
width?: number;
height?: number;
className?: string;
};
const Icon = ({ id, width = 20, height = 20, className, ...props }: Props) => {
const c = cx('icon', id, className);
const href = '#' + id;
return (
<svg className={c} width={width} height={height} {...props}>
<use xlinkHref={href} />
</svg>
);
};
export default React.memo(Icon);
|