2024-10-13 22:24:02 -04:00
|
|
|
import { Metadata } from "next";
|
|
|
|
import { TopbarNav } from "./components/TopbarNav";
|
2024-10-13 22:49:14 -04:00
|
|
|
import { Cog, LayoutGrid, Tent, Users } 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-13 22:24:02 -04:00
|
|
|
icon: <Tent />,
|
2024-10-13 18:33:41 -04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Resources",
|
2024-10-13 22:49:14 -04:00
|
|
|
href: "/{orgId}/resources",
|
2024-10-13 22:24:02 -04:00
|
|
|
icon: <LayoutGrid />,
|
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-13 22:49:14 -04:00
|
|
|
<div className="w-full bg-stone-200 border-b border-stone-300 mb-5 select-none sm:px-0 px-3">
|
2024-10-13 22:24:02 -04:00
|
|
|
<div className="container mx-auto flex flex-col content-between gap-3 pt-2">
|
|
|
|
<Header
|
2024-10-13 22:49:14 -04:00
|
|
|
email={user.email}
|
|
|
|
orgName={params.orgId}
|
2024-10-13 22:24:02 -04:00
|
|
|
/>
|
2024-10-13 22:49:14 -04:00
|
|
|
<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
|
|
|
}
|