summaryrefslogtreecommitdiffstats
path: root/src/ui/objects/Icon.tsx
blob: e8af7186b2e25b374fc0dec04a3f3b74a842f24f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import type { HTMLAttributes } from "corvos/plugins/jsx.ts";

import site from "@/corvos.config.ts";

export type Props = HTMLAttributes<"svg"> & {
	icon: Parameters<typeof site.$.icon>[0];
	variant?: Parameters<typeof site.$.icon>[1];
};

export const Icon = ({ icon, variant, class: cls, ...props }: Props) => (
	<svg
		aria-hidden="true"
		class:list={["o-icon", cls]}
		height="1.142857143em"
		width="1.142857143em"
		{...props}
	>
		<use href={site.$.icon(icon, variant)} />
	</svg>
);