summaryrefslogtreecommitdiff
path: root/src/components/Icon.tsx
blob: 5085b3a76a9f60a5bab886ce14e95f1241087c01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);