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

63 lines
2.0 KiB
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 08:25:44 +08:00
import {
AlertDialog,
AlertDialogAction,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
} from "@/components/ui/alert-dialog"
2025-04-23 12:14:43 +08:00
import { Clock } from "lucide-react"
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
<AlertDialog open={showMaintenanceAlert} onOpenChange={setShowMaintenanceAlert}>
2025-04-23 12:14:43 +08:00
<AlertDialogContent className="border border-muted">
<AlertDialogHeader className="gap-3">
<div className="flex items-center justify-center">
<Clock className="h-8 w-8 text-muted-foreground" />
</div>
<AlertDialogTitle className="text-lg font-medium">High Demand Notice</AlertDialogTitle>
2025-04-23 08:25:44 +08:00
<AlertDialogDescription>
2025-04-23 12:14:43 +08:00
Due to exceptionally high demand, our service is currently experiencing slower response times.
We recommend returning tomorrow when our systems will be operating at normal capacity.
2025-04-23 12:42:38 +08:00
<span className="mt-2 block">Thank you for your understanding.</span>
2025-04-23 08:25:44 +08:00
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
2025-04-23 12:14:43 +08:00
<AlertDialogAction>I'll Return Tomorrow</AlertDialogAction>
2025-04-23 08:25:44 +08:00
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
2025-04-16 02:14:58 +08:00
</SidebarProvider>
)
2025-04-16 01:20:15 +08:00
}