884054fb
“wangming”
项目初始化
|
1
2
3
4
|
import React from 'react';
import { ChevronRight } from 'lucide-react';
import { Sidebar } from './Sidebar';
import { Header } from './Header';
|
699ea6e8
杨鑫
完善打印逻辑
|
5
|
import type { CurrentUserMenuNodeDto } from '../../types/authSession';
|
884054fb
“wangming”
项目初始化
|
6
7
8
9
10
|
interface LayoutProps {
children: React.ReactNode;
currentView: string;
setCurrentView: (view: string) => void;
|
699ea6e8
杨鑫
完善打印逻辑
|
11
12
|
menus?: CurrentUserMenuNodeDto[];
onLogout?: () => void;
|
884054fb
“wangming”
项目初始化
|
13
14
|
}
|
699ea6e8
杨鑫
完善打印逻辑
|
15
|
export function Layout({ children, currentView, setCurrentView, menus, onLogout }: LayoutProps) {
|
884054fb
“wangming”
项目初始化
|
16
17
|
return (
<div className="flex h-screen bg-gray-50 overflow-hidden font-sans">
|
699ea6e8
杨鑫
完善打印逻辑
|
18
|
<Sidebar currentView={currentView} setCurrentView={setCurrentView} menus={menus} onLogout={onLogout} />
|
884054fb
“wangming”
项目初始化
|
19
|
<div className="flex-1 flex flex-col min-w-0 overflow-hidden">
|
699ea6e8
杨鑫
完善打印逻辑
|
20
|
<Header title={currentView} onSettingsClick={() => setCurrentView('Support')} />
|
884054fb
“wangming”
项目初始化
|
21
22
23
24
25
26
27
28
29
30
31
32
33
|
<div className="px-8 mt-8 shrink-0">
<nav className="flex items-center gap-2 text-sm font-normal" aria-label="Breadcrumb">
<button
type="button"
onClick={() => setCurrentView('Dashboard')}
className="text-gray-500 hover:text-gray-700 transition-colors"
>
Home
</button>
<ChevronRight className="w-4 h-4 text-gray-500 shrink-0" />
<span style={{ color: 'rgb(43, 50, 143)' }}>{currentView}</span>
</nav>
</div>
|
699ea6e8
杨鑫
完善打印逻辑
|
34
35
|
<main className="min-h-0 flex-1 overflow-y-auto p-8">
<div className="h-full min-h-0 w-full">
|
884054fb
“wangming”
项目初始化
|
36
37
38
39
40
41
42
|
{children}
</div>
</main>
</div>
</div>
);
}
|