Files
buzz/components/modal.tsx
T
dmgnr a31c8fbb54
Build and Push Image / build-backend (push) Successful in 52s
Build and Push Image / build-frontend (push) Successful in 2m8s
Build and Push Image / push (push) Successful in 1m24s
chore: oxc
2026-06-10 01:44:11 +07:00

41 lines
818 B
TypeScript
Executable File

"use client";
import { useRouter } from "next/navigation";
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
import { cn } from "@/lib/utils";
export function ModalBase({
children,
title,
wrap,
full,
}: {
children: React.ReactNode;
title: string;
wrap?: boolean;
full?: boolean;
}) {
const router = useRouter();
return (
<Dialog open={true} onOpenChange={() => router.back()}>
<DialogContent
className={cn(
wrap && "p-0",
full && "flex h-full max-w-dvw! flex-col lg:h-[90%] lg:max-w-[90%]!",
)}
>
<DialogHeader className={cn(wrap && "sr-only hidden")}>
<DialogTitle>{title}</DialogTitle>
</DialogHeader>
{children}
</DialogContent>
</Dialog>
);
}