'use client'; import * as React from 'react'; const Dialog = ({ children, open, onOpenChange }: any) => { return ( <> {React.Children.map(children, (child) => React.cloneElement(child, { open, onOpenChange }) )} ); }; const DialogTrigger = ({ children, asChild, onOpenChange }: any) => { if (asChild) { return React.cloneElement(children, { onClick: () => onOpenChange?.(true), }); } return ( ); }; const DialogContent = React.forwardRef( ({ className, children, open, onOpenChange, ...props }, ref) => { if (!open) return null; return ( <>
onOpenChange?.(false)} />
{children}
); } ); DialogContent.displayName = 'DialogContent'; const DialogHeader = ({ className, ...props }: React.HTMLAttributes) => (
); DialogHeader.displayName = 'DialogHeader'; const DialogFooter = ({ className, ...props }: React.HTMLAttributes) => (
); DialogFooter.displayName = 'DialogFooter'; const DialogTitle = React.forwardRef< HTMLHeadingElement, React.HTMLAttributes >(({ className, ...props }, ref) => (

)); DialogTitle.displayName = 'DialogTitle'; const DialogDescription = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes >(({ className, ...props }, ref) => (

)); DialogDescription.displayName = 'DialogDescription'; export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };