import { cn } from "@/lib/utils/cn" import { ReactNode } from "react" import { IconType } from "react-icons/lib" import { SingleIcon } from "../single-icon" export function IconSwitch({ onIcon, onIconAlt, offIcon, offIconAlt, onClick, isToggledOn = false, isAlt = false, disabled = false, className = "", size = "md", thickOnHover = false, children = null, iconClass = "", }: { onIcon: IconType onIconAlt?: IconType offIcon: IconType offIconAlt?: IconType onClick?: () => void isToggledOn?: boolean isAlt?: boolean disabled?: boolean className?: string size?: "2xs" | "xs" | "sm" | "md" thickOnHover?: boolean children?: ReactNode iconClass?: string }) { const iconSize = size === "2xs" ? "w-4 h-4" : size === "xs" ? "w-5 h-5" : size === "sm" ? "w-6 h-6" : size === "md" ? "w-7 h-7" : "w-8 h-8" return (
{ if (!disabled) { onClick() } } : undefined} >
{children ?
{children}
: null}
) }