Profil nicht gefunden
Für deinen Account existiert kein Profil. Bitte wende dich an einen Admin.
import Link from "next/link"; import { navigationFuer } from "@/lib/navigation"; import { rollenBezeichnung } from "@/lib/auth/roles"; import { UntereLeiste } from "@/components/navigation/UntereLeiste"; import { redirect } from "next/navigation"; import { Inter } from "next/font/google"; import "./globals.css"; import { loadProfile } from "@/lib/auth/profile"; import { ladeEigeneFirma } from "@/lib/firma/eigene-firma"; import { themeVariablen } from "@/lib/firma/farben"; import { FirmenLogo } from "@/components/FirmenLogo"; import { NavLinks } from "@/components/NavLinks"; import { LogoutButton } from "@/components/LogoutButton"; import { MobileNav } from "@/components/MobileNav"; import { PwaHead } from "@/components/pwa/PwaHead"; import { ServiceWorkerRegistrierung } from "@/components/pwa/ServiceWorkerRegistrierung"; import { OfflineBalken } from "@/components/pwa/OfflineBalken"; import { themeFarbe } from "@/lib/pwa/manifest"; const inter = Inter({ subsets: ["latin"], variable: "--font-inter" }); export const metadata = { title: "Aushilfsfahrer", }; export async function generateViewport() { const ergebnis = await ladeEigeneFirma(); return { themeColor: themeFarbe(ergebnis.status === "ok" ? ergebnis.firma : null) }; } export default async function RootLayout({ children, }: Readonly<{ children: React.ReactNode }>) { const result = await loadProfile(); const firmaErgebnis = await ladeEigeneFirma(); if (result.status === "ok" && firmaErgebnis.status === "keine-firma") { redirect("/abmelden?grund=firma"); } const firma = firmaErgebnis.status === "ok" ? firmaErgebnis.firma : null; const themeStyle = firma ? (themeVariablen(firma) as React.CSSProperties) : undefined; if (result.status === "missing-profile") { return (
Für deinen Account existiert kein Profil. Bitte wende dich an einen Admin.