'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 DialogClose=DialogPrimitive.Close;
const DialogContent=React.forwardRef<React.ElementRef<typeof DialogPrimitive.Content>,React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>>(({className,children,...props},ref)=><DialogPrimitive.Portal><DialogPrimitive.Overlay className="fixed inset-0 z-50 bg-black/70 backdrop-blur-sm"/><DialogPrimitive.Content ref={ref} className={cn('fixed left-1/2 top-1/2 z-50 w-[calc(100%-32px)] max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-border bg-card p-6 shadow-2xl',className)} {...props}>{children}<DialogPrimitive.Close className="absolute right-4 top-4 opacity-60 hover:opacity-100"><X size={18}/></DialogPrimitive.Close></DialogPrimitive.Content></DialogPrimitive.Portal>);DialogContent.displayName='DialogContent';
const DialogHeader=({className,...props}:React.HTMLAttributes<HTMLDivElement>)=><div className={cn('mb-4 flex flex-col gap-1',className)} {...props}/>;
const DialogTitle=React.forwardRef<React.ElementRef<typeof DialogPrimitive.Title>,React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>>(({className,...props},ref)=><DialogPrimitive.Title ref={ref} className={cn('font-bold text-lg',className)} {...props}/>);DialogTitle.displayName='DialogTitle';
const DialogDescription=React.forwardRef<React.ElementRef<typeof DialogPrimitive.Description>,React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>>(({className,...props},ref)=><DialogPrimitive.Description ref={ref} className={cn('text-sm text-muted-foreground',className)} {...props}/>);DialogDescription.displayName='DialogDescription';export{Dialog,DialogTrigger,DialogContent,DialogHeader,DialogTitle,DialogDescription,DialogClose};
