"use client" import { Dialog, DialogContent, DialogHeader, DialogTitle, } from "@/components/ui/dialog" import { Loader2 } from "lucide-react" import { useRouter } from "next/navigation" import { useEffect } from "react" export default function DisableAccessModal({ open, setOpen, message, }: { open: boolean setOpen: (open: boolean) => void message: string }) { const router = useRouter() useEffect(() => { if (open) { const timeout = setTimeout(() => { router.push("/dashboard") }, 5000) return () => clearTimeout(timeout) } }, []) return ( Live Collaboration Disabled
{message}
Redirecting you to dashboard...
) }