Dashboard Verbessert

This commit is contained in:
Moritz Utcke
2024-02-25 12:30:30 +07:00
parent 1bfd491f97
commit 23c480dae1
7 changed files with 116 additions and 20 deletions

View File

@@ -6,7 +6,20 @@ import "../../svelte-dialogs.config"
import "svelte-ripple-action/ripple.css"
import DashboardSidebar from "../components/Dashboard/DashboardSidebar.svelte"
import { NotificationWrapper } from "@ibcornelsen/ui";
import { validateAccessTokenServer } from "src/server/lib/validateAccessToken";
import { prisma } from "@ibcornelsen/database/server";
import { createCaller } from "#lib/caller";
const valid = validateAccessTokenServer(Astro)
if (!valid) {
Astro.redirect("/auth/login", 302)
}
const caller = createCaller(Astro)
const benutzer = await caller.v1.benutzer.self()
export interface Props {
title: string;
@@ -91,7 +104,7 @@ let lightTheme = Astro.cookies.get("theme").value === "light";
</head>
<body class="min-h-screen grid md:grid-cols-[300px_1fr]">
<DashboardSidebar lightTheme={lightTheme} client:load></DashboardSidebar>
<DashboardSidebar lightTheme={lightTheme} benutzer={benutzer} client:load></DashboardSidebar>
<main class="p-8 overflow-auto h-screen bg-base-100">
<slot />
</main>