"use client"; import { cn } from "@core/lib/utils"; import * as React from "react"; export interface CustomRadioProps { id: string; name: string; value: string; label: string; checked?: boolean; onChange?: (value: string) => void; variant?: "primary" | "info" | "error"; disabled?: boolean; error?: string; } const CustomRadio = React.forwardRef( ( { id, name, value, label, checked, onChange, variant = "primary", disabled, error, }, ref ) => { const finalVariant = error ? "error" : variant; return (
onChange?.(e.target.value)} disabled={disabled} ref={ref} className="peer h-5 w-5 cursor-pointer appearance-none rounded-full border-2 transition-all duration-200 disabled:cursor-not-allowed disabled:opacity-50" style={{ borderColor: disabled ? "#d1d5db" : finalVariant === "primary" ? "#2563eb" : finalVariant === "info" ? "#0891b2" : "#ef4444", }} />
{error && (

{error}

)}
); } ); CustomRadio.displayName = "CustomRadio"; export { CustomRadio };