"use client" import * as React 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 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 DialogContent = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, children, onInteractOutside, ...props }, ref) => ( { onInteractOutside?.(event) const target = event.target if (target instanceof Element && target.closest('[data-dialog-companion]')) { event.preventDefault() } }} className={cn( "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-[var(--shadow-md)] max-h-[calc(100dvh-2rem)] overflow-y-auto scrollbar-visible 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-98 data-[state=open]:zoom-in-98 sm:rounded-xl", className )} {...props} > {children} Close )) DialogContent.displayName = DialogPrimitive.Content.displayName /** * Backdrop for non-modal dialogs. Radix renders no Overlay when the root has * `modal={false}`, so dialogs that opt out of modality (to keep the agent * sheet interactive above them) render this alongside DialogContent to keep * the standard veil. z-40 sits under DialogContent (z-50) and the agent * sheet (z-60). */ const DialogVeil = () => (