feat:admin

This commit is contained in:
2026-03-02 16:42:15 +01:00
parent 52563d80de
commit b343314931
19 changed files with 1221 additions and 8 deletions

View File

@@ -1,4 +1,21 @@
"use client";
import { Link } from "@tanstack/react-router";
import { useEffect, useState } from "react";
import { authClient } from "@/lib/auth-client";
export default function Footer() {
const [isAdmin, setIsAdmin] = useState(false);
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
authClient.getSession().then((session) => {
const user = session.data?.user as { role?: string } | undefined;
setIsAdmin(user?.role === "admin");
setIsLoading(false);
});
}, []);
return (
<footer className="snap-section relative z-40 flex h-[250px] flex-col items-center justify-center bg-[#d09035]">
<div className="text-center">
@@ -21,6 +38,14 @@ export default function Footer() {
<a href="/contact" className="transition-colors hover:text-white">
Contact
</a>
{!isLoading && isAdmin && (
<>
<span className="text-white/40">|</span>
<Link to="/admin" className="transition-colors hover:text-white">
Admin
</Link>
</>
)}
</div>
<div className="mt-6 font-['Intro',sans-serif] text-white/50 text-xs">