import * as React from 'react' import * as DialogPrimitive from '@radix-ui/react-dialog' import { cn } from '@/lib/utils' import { Ic } from '@/icons' const Dialog = DialogPrimitive.Root const DialogTrigger = DialogPrimitive.Trigger const DialogClose = DialogPrimitive.Close const DialogPortal = DialogPrimitive.Portal function DialogOverlay({ className, ...props }: React.ComponentProps) { return ( ) } export interface DialogContentProps extends React.ComponentProps { showCloseButton?: boolean } function DialogContent({ className, children, showCloseButton = true, onPointerDownOutside, onInteractOutside, ...props }: DialogContentProps) { return ( { // Prevent closing modal when clicking outside (backdrop) e.preventDefault() onPointerDownOutside?.(e) }} onInteractOutside={(e) => { e.preventDefault() onInteractOutside?.(e) }} {...props} > {children} {showCloseButton && ( بستن )} ) } const DialogTitle = DialogPrimitive.Title const DialogDescription = DialogPrimitive.Description function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) { return (
) } function DialogFooter({ className, ...props }: React.ComponentProps<'div'>) { return (
) } export { Dialog, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, }