Files
snort/packages/app/src/Icons/Icon.tsx
2023-10-16 15:48:56 +01:00

24 lines
535 B
TypeScript

import { MouseEventHandler } from "react";
import IconsSvg from "public/icons.svg";
export interface IconProps {
name: string;
size?: number;
height?: number;
className?: string;
onClick?: MouseEventHandler<SVGSVGElement>;
}
const Icon = (props: IconProps) => {
const size = props.size || 20;
const href = `${IconsSvg}#` + props.name;
return (
<svg width={size} height={props.height ?? size} className={props.className} onClick={props.onClick}>
<use href={href} />
</svg>
);
};
export default Icon;