import { buttonVariants } from "@/components/ui/button" import { cn } from "@/lib/utils" import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" import { cva, type VariantProps } from "class-variance-authority" import * as React from "react" const AlertDialog = AlertDialogPrimitive.Root const AlertDialogTrigger = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( {children} )) AlertDialogTrigger.displayName = AlertDialogPrimitive.Trigger.displayName const AlertDialogPortal = AlertDialogPrimitive.Portal const AlertDialogOverlay = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )) AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName const alertDialogContentVariants = cva( "fixed z-50 lg:w-full w-[92%] max-w-md rounded-2xl border-none shadow-2xl", { variants: { appearance: { default: "bg-white/95 dark:bg-neutral-900", destructive: "bg-red-50/95 dark:bg-red-950/90", }, }, defaultVariants: { appearance: "default", }, } ) export interface AlertDialogContentProps extends React.ComponentPropsWithoutRef, VariantProps { closeOnClickOutside?: boolean } const AlertDialogContent = React.forwardRef< React.ElementRef, AlertDialogContentProps >(({ className, appearance, closeOnClickOutside = true, ...props }, ref) => ( e.stopPropagation()} /> )) AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName const AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes) => (
) AlertDialogHeader.displayName = "AlertDialogHeader" const AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes) => (
) AlertDialogFooter.displayName = "AlertDialogFooter" const AlertDialogTitle = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )) AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName const AlertDialogDescription = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )) AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName const AlertDialogAction = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { variant?: VariantProps["variant"] size?: VariantProps["size"] } >(({ className, variant = "default", size = "default", ...props }, ref) => ( )) AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName const AlertDialogCancel = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { variant?: VariantProps["variant"] size?: VariantProps["size"] } >(({ className, variant = "ghost", size = "default", ...props }, ref) => ( )) AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, alertDialogContentVariants, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger }