summaryrefslogtreecommitdiffstats
path: root/src/ui/components/Logo.tsx
blob: a9ec9be6a779a1e6735bf1a7b770c05c8f1cc9ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import type { HTMLAttributes } from "corvos/plugins/jsx.ts";

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

export type Props = HTMLAttributes<"a"> & {
	size?: "sm" | "lg";
	variant?: "static-black" | "static-white";
};

export const Logo = async ({ size, variant, class: cls, ...props }: Props) => {
	const symbols = await site.load("assets/symbols.svg");

	return (
		<a
			aria-label="Home"
			class:list={[
				"c-logo",
				{
					[`c-logo--${size}`]: size,
					[`c-logo--${variant}`]: variant,
				},
				cls,
			]}
			href={site.$.url()}
			rel="home"
			{...props}
		>
			<svg class="c-logo__img">
				<title>Logo</title>
				<use href={`${symbols.url}#logo${size === "sm" ? "-sm" : ""}`} />
			</svg>
		</a>
	);
};