mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
add solid
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import { Link } from "@tanstack/solid-router";
|
||||
{{#if auth}}
|
||||
import UserMenu from "./user-menu";
|
||||
{{/if}}
|
||||
import { For } from "solid-js";
|
||||
|
||||
export default function Header() {
|
||||
const links = [
|
||||
{ to: "/", label: "Home" },
|
||||
{{#if auth}}
|
||||
{ to: "/dashboard", label: "Dashboard" },
|
||||
{{/if}}
|
||||
{{#if (includes examples "todo")}}
|
||||
{ to: "/todos", label: "Todos" },
|
||||
{{/if}}
|
||||
{{#if (includes examples "ai")}}
|
||||
{ to: "/ai", label: "AI Chat" },
|
||||
{{/if}}
|
||||
];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div class="flex flex-row items-center justify-between px-2 py-1">
|
||||
<nav class="flex gap-4 text-lg">
|
||||
<For each={links}>
|
||||
{(link) => <Link to={link.to}>{link.label}</Link>}
|
||||
</For>
|
||||
</nav>
|
||||
<div class="flex items-center gap-2">
|
||||
{{#if auth}}
|
||||
<UserMenu />
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Loader2 } from "lucide-solid";
|
||||
|
||||
export default function Loader() {
|
||||
return (
|
||||
<div class="flex h-full items-center justify-center pt-8">
|
||||
<Loader2 class="animate-spin" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user