Files
edr-platform/packages/ui-common/src/components/Layout/DashboardLayout.tsx
Michael Abebe 1c5ee19388 chore: fmt
2026-05-12 16:50:18 +03:00

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;