feat: massive front-end overhaul and initial github release

This commit is contained in:
Simeon Radivoev 2026-02-08 21:18:10 +02:00
parent a2b40e38bf
commit d5a0e70580
Signed by: simeonradivoev
GPG key ID: 7611A451D2A5D37A
303 changed files with 19840 additions and 676 deletions

View file

@ -0,0 +1,32 @@
import "virtual:svg-icons/register";
import { StaticAssetPath } from "../gen/static-icon-assets.gen";
type OnlySvgIcon<T extends string> = T extends `${infer Rest}.svg`
? Rest
: never;
type StripSvg<T extends string> = T extends `${infer Rest}.svg` ? Rest : T;
type ReplaceSlash<T extends string> = T extends `${infer Left}/${infer Right}`
? `${Left}-${ReplaceSlash<Right>}`
: T;
type IconName<T extends string> = ReplaceSlash<StripSvg<OnlySvgIcon<T>>>;
export type IconType = IconName<StaticAssetPath>;
export default function SvgIcon ({
icon,
prefix = "icon",
className,
...props
}: {
icon: IconType;
prefix?: string;
className?: string;
})
{
const symbolId = `#${prefix}-${icon}`;
return (
<svg className={className} {...props} aria-hidden="true">
<use href={symbolId} />
</svg>
);
}