Adds complete initial codebase for the RJ Bulk Supplies fuel delivery backoffice: - Authentication pages and protected route layouts - Customer, supplier, fuel purchase, and delivery note management - Custom reporting and customer statement sending tools - Full UI component library and Tailwind styling - Server actions, API routes, and PocketBase integration - Development scripts and project configuration updates - Updated README and package metadata
24 lines
734 B
TypeScript
24 lines
734 B
TypeScript
import { redirect } from "next/navigation";
|
|
import { getAuth } from "@/lib/auth";
|
|
import { Sidebar } from "@/components/shell/sidebar";
|
|
import { TopBar } from "@/components/shell/top-bar";
|
|
import { Providers } from "@/components/shell/providers";
|
|
|
|
export default async function AuthenticatedLayout({ children }: { children: React.ReactNode }) {
|
|
const { user } = await getAuth();
|
|
if (!user) {
|
|
redirect("/login");
|
|
}
|
|
|
|
return (
|
|
<Providers>
|
|
<div className="min-h-screen bg-background">
|
|
<Sidebar />
|
|
<div className="md:pl-64 flex flex-col min-h-screen">
|
|
<TopBar user={user} />
|
|
<main className="flex-1 p-4 md:p-6">{children}</main>
|
|
</div>
|
|
</div>
|
|
</Providers>
|
|
);
|
|
}
|