"use client"; import * as React from "react"; import * as DialogPrimitive from "@radix-ui/react-dialog"; import { X } from "lucide-react"; import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "@/src/utils/tailwind"; const Dialog = DialogPrimitive.Root; const DialogTrigger = DialogPrimitive.Trigger; const DialogPortal = DialogPrimitive.Portal; const DialogClose = DialogPrimitive.Close; const DialogOverlay = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; const dialogContentVariants = cva( "fixed left-[50%] top-[50%] overflow-hidden z-50 flex w-full flex-col translate-x-[-50%] translate-y-[-50%] bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", { variants: { size: { default: "max-w-lg max-h-[85vh]", lg: "max-w-4xl max-h-[85vh]", xl: "max-w-7xl h-[90vh]", }, }, defaultVariants: { size: "default", }, }, ); const DialogContent = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { closeOnInteractionOutside?: boolean; } & VariantProps >( ( { className, children, closeOnInteractionOutside = false, size, ...props }, ref, ) => ( { if (!closeOnInteractionOutside) { e.preventDefault(); } }} onInteractOutside={(e) => { if (!closeOnInteractionOutside) { e.preventDefault(); } }} {...props} > {children}
Close
), ); DialogContent.displayName = DialogPrimitive.Content.displayName; const DialogHeader = ({ className, children, ...props }: React.HTMLAttributes) => (
{children}
Close
); DialogHeader.displayName = "DialogHeader"; const DialogBody = React.forwardRef< HTMLDivElement, React.HTMLAttributes >(({ className, ...props }, ref) => (
)); DialogBody.displayName = "DialogBody"; const DialogFooter = ({ className, ...props }: React.HTMLAttributes) => (
); DialogFooter.displayName = "DialogFooter"; const DialogTitle = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); DialogTitle.displayName = DialogPrimitive.Title.displayName; const DialogDescription = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); DialogDescription.displayName = DialogPrimitive.Description.displayName; export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogBody, DialogFooter, DialogTitle, DialogDescription, };