shared user restrictions + cleanup console logs
This commit is contained in:
@ -9,7 +9,15 @@ import {
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog";
|
||||
|
||||
import { ChevronRight, FileStack, Globe, TextCursor } from "lucide-react";
|
||||
import {
|
||||
ChevronRight,
|
||||
FileStack,
|
||||
Globe,
|
||||
Loader2,
|
||||
TextCursor,
|
||||
} from "lucide-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useEffect } from "react";
|
||||
|
||||
export default function DisableAccessModal({
|
||||
open,
|
||||
@ -20,13 +28,30 @@ export default function DisableAccessModal({
|
||||
setOpen: (open: boolean) => void;
|
||||
message: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
if (open) {
|
||||
const timeout = setTimeout(() => {
|
||||
router.push("/dashboard");
|
||||
}, 5000);
|
||||
return () => clearTimeout(timeout);
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={setOpen}>
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<DialogTitle>Live Collaboration Disabled</DialogTitle>
|
||||
</DialogHeader>
|
||||
<div className="text-sm text-muted-foreground">{message}</div>
|
||||
<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>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
|
Reference in New Issue
Block a user