import { RadioGroup, RadioGroupItem } from "../ui/radio-group"; import type { AuthorityTier } from "../../services/relatedPersonAuthority"; import { TIER_LABELS } from "../../services/relatedPersonAuthority"; import { TIER_ORDER } from "./tierWords"; import "./careAccess.css"; interface TierChoicesProps { name: string; /** Undefined while the grant is still being read: no tier is claimed. */ value: AuthorityTier | undefined; descriptions: Record; onChange: (tier: AuthorityTier) => void; disabled?: boolean; } // The three tiers as choices a reader can compare, each with what it allows beside it. export const TierChoices = ({ name, value, descriptions, onChange, disabled = false }: TierChoicesProps) => ( onChange(next as AuthorityTier)} disabled={disabled} aria-label="What they may do" > {TIER_ORDER.map((tier) => { const id = `${name}-${tier}`; return (
); })}
); export default TierChoices;