import { forwardRef, type ComponentPropsWithoutRef, type ElementRef, type HTMLAttributes, } from "react"; import * as DialogPrimitive from "@radix-ui/react-dialog"; import { VisuallyHidden } from "@radix-ui/react-visually-hidden"; import { X } from "lucide-react"; import { useTranslation } from "react-i18next"; import { cn } from "@/lib/cn"; export const Root = DialogPrimitive.Root; type OverlayProps = ComponentPropsWithoutRef & { exitAnimation?: boolean; }; const Overlay = forwardRef, OverlayProps>( function DialogOverlay({ className, exitAnimation = false, ...props }, ref) { return ( ); }, ); type ContentProps = ComponentPropsWithoutRef & { showClose?: boolean; maxWidthClass?: string; exitAnimation?: boolean; srTitle?: string; srDescription?: string; }; export const Content = forwardRef, ContentProps>( function DialogContent( { className, children, showClose = true, maxWidthClass = "max-w-md", exitAnimation = false, srTitle, srDescription, ...props }, ref, ) { const { t } = useTranslation(); return ( e.stopPropagation()} {...props} > {srTitle ?? t("common.netbird")} {srDescription && ( {srDescription} )} {children} {showClose && ( )} ); }, ); export const Title = forwardRef< ElementRef, ComponentPropsWithoutRef >(function DialogTitle({ className, ...props }, ref) { return ( ); }); export const Description = forwardRef< ElementRef, ComponentPropsWithoutRef >(function DialogDescription({ className, ...props }, ref) { return ( ); }); type FooterProps = HTMLAttributes & { separator?: boolean; }; export const Footer = ({ className, separator = true, ...props }: FooterProps) => (
*]:w-full sm:[&>*]:w-auto", "px-8 pt-6", className, )} {...props} />
);