2024-05-07 21:19:32 -07:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
import {
|
|
|
|
Dialog,
|
|
|
|
DialogContent,
|
|
|
|
DialogDescription,
|
|
|
|
DialogHeader,
|
|
|
|
DialogTitle,
|
|
|
|
DialogTrigger,
|
|
|
|
} from "@/components/ui/dialog";
|
|
|
|
|
2024-05-07 22:40:59 -07:00
|
|
|
import {
|
|
|
|
ChevronRight,
|
|
|
|
FileStack,
|
|
|
|
Globe,
|
|
|
|
Loader2,
|
|
|
|
TextCursor,
|
|
|
|
} from "lucide-react";
|
|
|
|
import { useRouter } from "next/navigation";
|
|
|
|
import { useEffect } from "react";
|
2024-05-07 21:19:32 -07:00
|
|
|
|
|
|
|
export default function DisableAccessModal({
|
|
|
|
open,
|
|
|
|
setOpen,
|
|
|
|
message,
|
|
|
|
}: {
|
|
|
|
open: boolean;
|
|
|
|
setOpen: (open: boolean) => void;
|
|
|
|
message: string;
|
|
|
|
}) {
|
2024-05-07 22:40:59 -07:00
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
if (open) {
|
|
|
|
const timeout = setTimeout(() => {
|
|
|
|
router.push("/dashboard");
|
|
|
|
}, 5000);
|
|
|
|
return () => clearTimeout(timeout);
|
|
|
|
}
|
|
|
|
}, []);
|
|
|
|
|
2024-05-07 21:19:32 -07:00
|
|
|
return (
|
|
|
|
<Dialog open={open} onOpenChange={setOpen}>
|
|
|
|
<DialogContent>
|
|
|
|
<DialogHeader>
|
|
|
|
<DialogTitle>Live Collaboration Disabled</DialogTitle>
|
|
|
|
</DialogHeader>
|
2024-05-07 22:40:59 -07:00
|
|
|
<div className="text-sm text-muted-foreground space-y-2">
|
|
|
|
<div>{message}</div>
|
|
|
|
<div className="flex items-center">
|
|
|
|
<Loader2 className="w-4 h-4 animate-spin mr-2" />
|
|
|
|
Redirecting you to dashboard...
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-05-07 21:19:32 -07:00
|
|
|
</DialogContent>
|
|
|
|
</Dialog>
|
|
|
|
);
|
|
|
|
}
|