void/components/Icon.tsx
2022-10-19 23:58:03 +02:00

22 lines
No EOL
471 B
TypeScript

import { Icon } from "utils/types";
const Icon = ({ icon, className }: { icon: Icon, className?: string }) => {
let link;
switch (icon) {
case "note":
link = "/icons/note.svg"
break;
default:
link = `/icons/icons.svg#${icon}`
break;
}
return (
<svg className={className} width={"1.2em"} height={"1.2em"}>
<use href={link} />
</svg>
)
}
export default Icon