mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 10:56:28 +00:00
751b28fab2
Adds permission, menu, and role administration with hierarchical access controls, plus admin breadcrumbs and a redirect from the legacy user-role page. Remove `credentials.md` before committing; it contains server credentials.
61 lines
2.5 KiB
TypeScript
61 lines
2.5 KiB
TypeScript
import { Metadata } from "next";
|
|
import Link from "next/link";
|
|
import { ToggleTheme } from "./components/ToggleTheme";
|
|
import { Button } from "@/components/ui/button";
|
|
import Sidebar from "./components/Sidebar";
|
|
import Notification from "./components/Notification";
|
|
import { UserNav } from "../(dashboard)/components/UserNav";
|
|
import { House } from "lucide-react";
|
|
import AdminBreadcrumb from "./components/Breadcrumb";
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Admin Panel",
|
|
description: "H.A.T.s admin panel page",
|
|
}
|
|
|
|
export default async function AdminLayout({
|
|
children, // will be a page or nested layout
|
|
}: {
|
|
children: React.ReactNode
|
|
}) {
|
|
|
|
return (
|
|
<>
|
|
<main className="flex flex-col lg:flex-row h-screen overflow-hidden text-sm bg-soft dark:bg-zinc-900">
|
|
<Sidebar />
|
|
|
|
{/* CONTENT */}
|
|
<div className="overflow-x-hidden overflow-y-auto h-screen flex flex-col z-0 w-full px-5 pt-5">
|
|
|
|
{/* HEADER */}
|
|
<header className="sticky top-0 z-10 w-full hidden lg:flex justify-between items-center p-5 md:px-6 backdrop-blur-sm bg-white/70 dark:bg-zinc-950/80 rounded-xl border border-zinc-200 text-zinc-950 shadow dark:border-zinc-800 dark:text-zinc-50">
|
|
<AdminBreadcrumb />
|
|
<div className="flex items-center space-x-3">
|
|
<div className="flex items-center space-x-3 border-r pr-3 dark:border-zinc-800">
|
|
<Notification />
|
|
<ToggleTheme />
|
|
</div>
|
|
<Link href='/' title="Go to Homepage">
|
|
<Button variant='outline' size='icon'>
|
|
<House size={32} />
|
|
</Button>
|
|
</Link>
|
|
<UserNav />
|
|
</div>
|
|
</header>
|
|
|
|
<section className="-mt-5 sm:mt-5 mb-10">
|
|
{children}
|
|
</section>
|
|
|
|
<footer className="mt-auto flex items-center justify-between py-5 px-3 sm:px-0 text-xs md:text-sm font-medium text-zinc-400 text-center">
|
|
<p className="mx-auto w-9/12 sm:w-full">© {new Date().getFullYear()} - H.A.T.s | Design & Develop by H.I.S Dev Super Team 😎</p>
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
</main>
|
|
</>
|
|
);
|
|
}
|