import "./tailwind.css";
import "@fontsource/pixelify-sans";
import "@fontsource/nunito/800.css";
import "@fontsource/nunito";
import { useState } from "react";
import { usePageContext } from "vike-react/usePageContext";
import { IconBrandGithub, IconDownload, IconDeviceGamepad3, IconTrophy } from "@tabler/icons-react";
const links = [
{
label: "Play",
href: "/",
icon: ,
},
{
label: "Leaderboard",
href: "/leaderboard",
icon: ,
},
{
label: "Download",
href: "/download",
icon: ,
},
{
label: "GitHub",
href: "https://github.com/Xevion/Pac-Man",
icon: ,
},
];
export function Link({ href, label }: { href: string; label: string }) {
const pageContext = usePageContext();
const { urlPathname } = pageContext;
const isActive = href === "/" ? urlPathname === href : urlPathname.startsWith(href);
return (
{label}
);
}
export default function LayoutDefault({ children }: { children: React.ReactNode }) {
const [opened, setOpened] = useState(false);
const toggle = () => setOpened((v) => !v);
const close = () => setOpened(false);
const mainLinks = links
.filter((link) => link.href.startsWith("/"))
.map((link) => );
const sourceLinks = links
.filter((link) => !link.href.startsWith("/"))
.map((link) => (
{link.icon}
));
return (
{children}
{opened && (
Navigation
{links.map((link) => (
))}
)}
);
}