import { Button, Checkbox as AntCheckbox, Segmented, Select as AntSelect, Switch as AntSwitch, Tooltip as AntTooltip } from "antd"; import type { CheckboxChangeEvent } from "antd/es/checkbox"; import type { ButtonProps } from "antd"; import type { LucideIcon } from "lucide-react"; import type { CSSProperties, InputHTMLAttributes, ReactNode } from "react"; import { cn } from "@/lib/utils"; export function AdminSwitch({ size = "md", className, ...props }: { checked?: boolean; defaultChecked?: boolean; disabled?: boolean; loading?: boolean; size?: "sm" | "md"; checkedChildren?: ReactNode; unCheckedChildren?: ReactNode; onChange?: (checked: boolean) => void; className?: string; "aria-label"?: string; }) { return props.onChange?.(checked)} />; } export function Switch(props: Parameters[0]) { return ; } export function AdminSelect({ size = "md", ariaLabel, className, onChange, ...props }: { value?: V; onChange?: (value: V) => void; options?: Array<{ value: V; label: ReactNode; disabled?: boolean; title?: string }>; placeholder?: string; disabled?: boolean; allowClear?: boolean; size?: "sm" | "md"; ariaLabel?: string; className?: string; }) { return onChange?.(value as V)} />; } export function Select(props: Parameters>[0]) { return {...props} />; } export function AdminCheckbox({ bare, size, children, className, onChange, ...props }: Omit, "size" | "onChange"> & { size?: "sm" | "md"; indeterminate?: boolean; bare?: boolean; children?: ReactNode; onChange?: (event: CheckboxChangeEvent) => void; }) { return ( {bare ? null : children} ); } export function Checkbox(props: Parameters[0]) { return ; } export function AdminTooltip({ title, placement = "top", delay = 80, children }: { title?: ReactNode; placement?: "top" | "right" | "bottom" | "left"; delay?: number; children: ReactNode }) { if (!title) return <>{children}; return ( {children} ); } export function Tooltip(props: Parameters[0]) { return ; } export function AdminIconButton({ icon: Icon, size = "sm", className, variant: _variant, ...props }: { icon: LucideIcon; size?: "sm" | "md"; variant?: "ghost" | "default"; className?: string; disabled?: boolean; loading?: boolean; title?: string; "aria-label"?: string; onClick?: ButtonProps["onClick"]; }) { return