fosrl.pangolin/src/app/[orgId]/layout.tsx

64 lines
1.6 KiB
TypeScript
Raw Normal View History

2024-10-13 22:24:02 -04:00
import { Metadata } from "next";
import { TopbarNav } from "./components/TopbarNav";
2024-10-14 00:02:55 -04:00
import { Cog, Combine, LayoutGrid, Tent, Users, Waypoints } from "lucide-react";
2024-10-13 22:24:02 -04:00
import Header from "./components/Header";
2024-10-13 22:49:14 -04:00
import { verifySession } from "@app/lib/auth/verifySession";
import { redirect } from "next/navigation";
2024-10-13 18:33:41 -04:00
export const metadata: Metadata = {
2024-10-13 22:24:02 -04:00
title: "Configuration",
description: "",
};
2024-10-13 18:33:41 -04:00
2024-10-13 22:24:02 -04:00
const topNavItems = [
2024-10-13 18:33:41 -04:00
{
title: "Sites",
2024-10-13 22:49:14 -04:00
href: "/{orgId}/sites",
2024-10-14 00:02:55 -04:00
icon: <Combine />,
2024-10-13 18:33:41 -04:00
},
{
title: "Resources",
2024-10-13 22:49:14 -04:00
href: "/{orgId}/resources",
2024-10-14 00:02:55 -04:00
icon: <Waypoints />,
2024-10-13 18:33:41 -04:00
},
2024-10-13 22:49:14 -04:00
{
title: "Users",
href: "/{orgId}/users",
icon: <Users />,
},
{
title: "General",
href: "/{orgId}/general",
icon: <Cog />,
},
2024-10-13 22:24:02 -04:00
];
2024-10-13 18:33:41 -04:00
2024-10-13 22:24:02 -04:00
interface ConfigurationLaytoutProps {
children: React.ReactNode;
2024-10-13 22:49:14 -04:00
params: { orgId: string };
2024-10-13 18:33:41 -04:00
}
2024-10-13 22:24:02 -04:00
export default async function ConfigurationLaytout({
children,
params,
}: ConfigurationLaytoutProps) {
2024-10-13 22:49:14 -04:00
const user = await verifySession();
if (!user) {
redirect("/auth/login");
}
2024-10-13 18:33:41 -04:00
return (
<>
2024-10-14 12:10:02 -04:00
<div className="w-full bg-neutral-100 border-b border-neutral-200 mb-6 select-none sm:px-0 px-3 pt-3">
<div className="container mx-auto flex flex-col content-between gap-4">
2024-10-14 00:02:55 -04:00
<Header email={user.email} orgName={params.orgId} />
<TopbarNav items={topNavItems} orgId={params.orgId} />
2024-10-13 18:33:41 -04:00
</div>
</div>
2024-10-13 22:24:02 -04:00
2024-10-13 22:49:14 -04:00
<div className="container mx-auto sm:px-0 px-3">{children}</div>
2024-10-13 18:33:41 -04:00
</>
2024-10-13 22:24:02 -04:00
);
2024-10-13 18:33:41 -04:00
}