suna/frontend/src/app/(dashboard)/layout.tsx

41 lines
961 B
TypeScript
Raw Normal View History

2025-04-16 13:41:55 +08:00
"use client"
2025-04-23 08:25:44 +08:00
import { useEffect, useState } from "react"
2025-04-21 00:08:17 +08:00
import { SidebarLeft } from "@/components/sidebar/sidebar-left"
2025-04-16 02:14:58 +08:00
import {
SidebarInset,
SidebarProvider,
} from "@/components/ui/sidebar"
2025-04-23 16:20:10 +08:00
import { MaintenanceAlert } from "@/components/maintenance-alert"
2025-04-16 02:37:56 +08:00
2025-04-16 02:14:58 +08:00
interface DashboardLayoutProps {
children: React.ReactNode
2025-04-13 00:37:45 +08:00
}
2025-04-16 13:41:55 +08:00
export default function DashboardLayout({
2025-04-13 00:37:45 +08:00
children,
2025-04-16 02:14:58 +08:00
}: DashboardLayoutProps) {
2025-04-23 08:25:44 +08:00
const [showMaintenanceAlert, setShowMaintenanceAlert] = useState(false)
useEffect(() => {
// Show the maintenance alert when component mounts
setShowMaintenanceAlert(true)
}, [])
2025-04-12 08:04:40 +08:00
return (
2025-04-16 02:14:58 +08:00
<SidebarProvider>
2025-04-16 15:16:38 +08:00
<SidebarLeft />
2025-04-16 02:14:58 +08:00
<SidebarInset>
2025-04-16 08:04:04 +08:00
<div className="bg-background">
{children}
</div>
2025-04-16 02:14:58 +08:00
</SidebarInset>
2025-04-23 08:25:44 +08:00
2025-04-23 16:20:10 +08:00
<MaintenanceAlert
open={showMaintenanceAlert}
onOpenChange={setShowMaintenanceAlert}
closeable={true}
/>
2025-04-16 02:14:58 +08:00
</SidebarProvider>
)
2025-04-16 01:20:15 +08:00
}