'use client';
import * as React from 'react';
import { cn } from '@/lib/utils';
interface DialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
children: React.ReactNode;
}
function Dialog({ open, onOpenChange, children }: DialogProps) {
React.useEffect(() => {
if (open) {
document.body.style.overflow = 'hidden';
} else {
document.body.style.overflow = '';
}
return () => {
document.body.style.overflow = '';
};
}, [open]);
if (!open) return null;
return (
onOpenChange(false)}
/>
{children}
);
}
const DialogContent = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes
>(({ className, children, ...props }, ref) => (
e.stopPropagation()}
{...props}
>
{children}
));
DialogContent.displayName = 'DialogContent';
function DialogHeader({ className, ...props }: React.HTMLAttributes) {
return (
);
}
function DialogTitle({ className, ...props }: React.HTMLAttributes) {
return (
);
}
function DialogDescription({ className, ...props }: React.HTMLAttributes) {
return (
);
}
function DialogFooter({ className, ...props }: React.HTMLAttributes) {
return (
);
}
export { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter };