"use client"; import { ShieldAlert } from "lucide-react"; import { usePathname } from "next/navigation"; import { useState } from "react"; import { Badge } from "@/components/ui/badge"; import { Checkbox } from "@/components/ui/checkbox"; import { cn } from "@/lib/utils"; type SidebarMaintenanceControlProps = { action: (formData: FormData) => Promise; initialEnabled: boolean; label: string; onLabel: string; offLabel: string; }; export function SidebarMaintenanceControl({ action, initialEnabled, label, onLabel, offLabel, }: SidebarMaintenanceControlProps) { const pathname = usePathname(); const [enabled, setEnabled] = useState(initialEnabled); return (