'use client'; import * as React from 'react'; import { useState } from 'react'; import * as DialogPrimitive from '@radix-ui/react-dialog'; import { X } from 'lucide-react'; import { cn } from '@/lib/utils'; const Dialog = DialogPrimitive.Root; const DialogPortal = ({ ...props }: DialogPrimitive.DialogPortalProps) => ; DialogPortal.displayName = DialogPrimitive.Portal.displayName; const DialogOverlay = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => (
{children}
)); DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; const DialogContent = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { onClose?: () => void } >(({ className, children, ...props }, ref) => { return (
{children}
); }); DialogContent.displayName = DialogPrimitive.Content.displayName; const Modal: React.FC<{ children: React.ReactNode; className?: string; onClose: () => void; }> = ({ children, onClose, className }) => { const [open, setOpen] = useState(true); const handleClose = () => { console.log(onClose()); console.log('closing'); setOpen(false); }; return ( {children} ); }; export { Dialog, DialogContent, Modal };