<% id_prefix ||= "radio-#{SecureRandom.hex(4)}" items ||= [] %> <% items.each_with_index do |item, index| %> <% if item === :or %> <%= t('components.radio.or') %> <% else %> <% item_next = items[index + 1] unless index === items.size - 1 label_id = item[:id] ? item[:id] : "#{id_prefix}-#{index}" label_hint_id = "label-hint-#{SecureRandom.hex(4)}" if item[:hint_text].present? %>
<% if label_hint_id %> aria-describedby="<%= label_hint_id %>" <% end %> > <%= render "govuk_publishing_components/components/label", { hint_id: label_hint_id, html_for: label_id, classes: 'gem-c-radio__label', text_classes: 'gem-c-radio__label__text', hint_text_classes: 'gem-c-radio__label__hint', hint_text: item[:hint_text], text: item[:text], bold: item[:bold] } %>
<% end %> <% end %>