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 { useTranslation } from "react-i18next"; import { cn } from "@/lib/utils"; const Sheet = DialogPrimitive.Root; const SheetTrigger = DialogPrimitive.Trigger; const SheetPortal = DialogPrimitive.Portal; const SheetOverlay = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); SheetOverlay.displayName = DialogPrimitive.Overlay.displayName; const sheetVariants = cva( "fixed z-50 flex flex-col gap-4 bg-background outline-none transition ease-in-out", { variants: { side: { top: cn( "inset-x-0 top-0", "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top", ), bottom: cn( "inset-x-0 bottom-0", "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom", ), left: cn( "inset-y-0 left-0 h-full w-3/4 sm:max-w-sm", "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left", ), right: cn( "inset-y-0 right-0 h-full w-3/4 sm:max-w-sm", "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right", ), }, }, defaultVariants: { side: "right", }, }, ); interface SheetContentProps extends React.ComponentPropsWithoutRef, VariantProps { closeButtonClassName?: string; showCloseButton?: boolean; overlayClassName?: string; } const SheetContent = React.forwardRef< React.ElementRef, SheetContentProps >(( { side = "right", className, children, closeButtonClassName, showCloseButton = true, overlayClassName, ...props }, ref, ) => { const { t } = useTranslation(); return ( {children} {showCloseButton ? ( {t("common.close")} ) : null} ); }); SheetContent.displayName = DialogPrimitive.Content.displayName; const SheetTitle = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); SheetTitle.displayName = DialogPrimitive.Title.displayName; const SheetDescription = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); SheetDescription.displayName = DialogPrimitive.Description.displayName; export { Sheet, SheetTrigger, SheetContent, SheetDescription, SheetTitle };