mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 06:40:57 +00:00
39 lines
996 B
TypeScript
39 lines
996 B
TypeScript
import { ReactNode } from "react";
|
|
import Sidebar, { SidebarItem } from "./Sidebar";
|
|
|
|
export interface DashboardLayoutProps {
|
|
title?: string;
|
|
sidebarItems: SidebarItem[];
|
|
activeHref?: string;
|
|
onNavigate?: (href: string) => void;
|
|
headerRight?: ReactNode;
|
|
children: ReactNode;
|
|
}
|
|
|
|
const DashboardLayout = ({
|
|
title,
|
|
sidebarItems,
|
|
activeHref,
|
|
onNavigate,
|
|
headerRight,
|
|
children,
|
|
}: DashboardLayoutProps) => (
|
|
<div className="flex min-h-screen bg-gray-50">
|
|
<Sidebar
|
|
title={title}
|
|
items={sidebarItems}
|
|
activeHref={activeHref}
|
|
onNavigate={onNavigate}
|
|
/>
|
|
<div className="flex flex-1 flex-col">
|
|
<header className="flex items-center justify-between border-b border-gray-200 bg-white px-6 py-3">
|
|
<div className="text-sm font-medium text-gray-700">{title}</div>
|
|
<div>{headerRight}</div>
|
|
</header>
|
|
<main className="flex-1 overflow-auto p-6">{children}</main>
|
|
</div>
|
|
</div>
|
|
);
|
|
|
|
export default DashboardLayout;
|