import React from "react"; // helpers import { cn } from "@/helpers/common.helper"; type RadioInputProps = { name?: string; label: string | React.ReactNode | undefined; wrapperClassName?: string; fieldClassName?: string; buttonClassName?: string; labelClassName?: string; ariaLabel?: string; options: { label: string | React.ReactNode; value: string; disabled?: boolean }[]; vertical?: boolean; selected: string; onChange: (value: string) => void; className?: string; }; export const RadioInput = ({ name = "radio-input", label: inputLabel, labelClassName: inputLabelClassName = "", wrapperClassName: inputWrapperClassName = "", fieldClassName: inputFieldClassName = "", buttonClassName: inputButtonClassName = "", options, vertical, selected, ariaLabel, onChange, className, }: RadioInputProps) => { const wrapperClass = vertical ? "flex flex-col gap-1" : "flex gap-2"; const setSelected = (value: string) => { onChange(value); }; let aria = ariaLabel ? ariaLabel.toLowerCase().replace(" ", "-") : ""; if (!aria && typeof inputLabel === "string") { aria = inputLabel.toLowerCase().replace(" ", "-"); } else { aria = "radio-input"; } return (