This repository has been archived on 2025-11-04. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
days-since/src/app/@modal/(.)timer/[id]/modal.tsx

24 lines
623 B
TypeScript

"use client";
import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog";
import { useRouter } from "next/navigation";
export default function Modal({ children }: { children: React.ReactNode }) {
const router = useRouter();
const handleOpenChange = (open: boolean) => {
if (!open) {
router.back();
}
};
return (
<Dialog defaultOpen onOpenChange={handleOpenChange}>
<div className="w-screen">
<DialogContent className="h-2/3 max-w-6xl">
<DialogTitle hidden>{}</DialogTitle>
{children}
</DialogContent>
</div>
</Dialog>
);
}