- Convert Mantine-based components to TailwindCSS + Recharts - Add dark mode support for all dashboard pages - Update routing to allow public dashboard access - Components refactored: - kinreja-divisi.tsx: Village performance dashboard - pengaduan-layanan-publik.tsx: Public complaint management - jenna-analytic.tsx: Chatbot analytics dashboard - demografi-pekerjaan.tsx: Demographic analytics - keuangan-anggaran.tsx: APBDes financial dashboard - bumdes-page.tsx: UMKM sales monitoring - sosial-page.tsx: Village social monitoring - Remove landing page, redirect / to /dashboard - Update auth middleware for public dashboard access Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
31 lines
746 B
TypeScript
31 lines
746 B
TypeScript
/** biome-ignore-all lint/suspicious/noExplicitAny: <explanation */
|
|
import { authStore } from "@/store/auth";
|
|
import "@mantine/core/styles.css";
|
|
import "@mantine/dates/styles.css";
|
|
import { createRootRoute, Outlet } from "@tanstack/react-router";
|
|
|
|
export const Route = createRootRoute({
|
|
component: RootComponent,
|
|
beforeLoad: async () => {
|
|
// Fetch session but don't block navigation
|
|
try {
|
|
const res = await fetch("/api/session", {
|
|
method: "GET",
|
|
credentials: "include",
|
|
});
|
|
if (res.ok) {
|
|
const { data } = await res.json();
|
|
authStore.user = data?.user;
|
|
authStore.session = data;
|
|
}
|
|
} catch {
|
|
// Ignore errors, allow public access
|
|
}
|
|
return {};
|
|
},
|
|
});
|
|
|
|
function RootComponent() {
|
|
return <Outlet />;
|
|
}
|