30 lines
1.4 KiB
TypeScript
30 lines
1.4 KiB
TypeScript
'use client'
|
|
|
|
import DepartmentShell from './DepartmentShell'
|
|
import PermissionGroupsDashboard from './PermissionGroupsDashboard'
|
|
import UserPermissionsDashboard from './UserPermissionsDashboard'
|
|
import WorkspaceViewNavigation from './WorkspaceViewNavigation'
|
|
|
|
export default function PermissionsDashboard({ view = 'groups' }: { view?: 'groups' | 'people' }) {
|
|
return (
|
|
<DepartmentShell>
|
|
<main className="px-4 py-5 sm:px-6 lg:flex lg:h-[calc(100dvh-72px)] lg:min-h-0 lg:flex-col lg:px-8">
|
|
<header className="mb-4 flex shrink-0 flex-wrap items-center justify-between gap-3">
|
|
<h1 className="text-2xl font-bold text-[#101828]">权限管理</h1>
|
|
<WorkspaceViewNavigation label="权限管理视图" items={[
|
|
{ label: '权限组', href: '/workspaces/governance/permissions', active: view === 'groups' },
|
|
{ label: '人员权限', href: '/workspaces/governance/permissions?view=people', active: view === 'people' },
|
|
]} />
|
|
</header>
|
|
{/* Keep both workspaces mounted so switching views preserves drafts and search. */}
|
|
<div hidden={view !== 'groups'} className={view === 'groups' ? 'min-h-0 lg:flex-1' : 'hidden'}>
|
|
<PermissionGroupsDashboard embedded />
|
|
</div>
|
|
<div hidden={view !== 'people'} className={view === 'people' ? 'min-h-0 lg:flex-1' : 'hidden'}>
|
|
<UserPermissionsDashboard embedded />
|
|
</div>
|
|
</main>
|
|
</DepartmentShell>
|
|
)
|
|
}
|