"use client"; import { ExplanationUiFont } from "./explanation-ui-font"; import type { QuestionField } from "@/lib/schema-adapter"; import { useQuestionAnswers } from "./question-answer-storage"; import QuestionTitle from "./question-title"; type QuestionRadioProps = { question: QuestionField; disabled?: boolean; }; export function QuestionRadio({ question, disabled, }: QuestionRadioProps) { const options = question.options || []; const { getAnswerValue, setAnswerValue } = useQuestionAnswers(); const value = getAnswerValue(question); if (options.length === 0) { return null; } // Render horizontally only for 2-option binary choices (e.g. Yes/No, Male/Female) const isShortOptions = options.length <= 2 && options.every((opt) => String(opt.label || opt.value || "").length <= 10); return (