<% form_contents = capture do %>
  <% if question.body.present? %>
    <%= question.body %>
  <% end %>

  <% if question.hint.present? %>
    <p class="govuk-hint"><%= question.hint %></p>
  <% end %>

  <%= render "govuk_publishing_components/components/date_input", {
    error_message: question.error,
    items: [
      question.default_day ? nil : {
        label: "Day",
        name: "response[day]",
        width: 2,
        value: question.selected_day,
      },
      question.default_month ? nil : {
        label: "Month",
        name: "response[month]",
        width: 2,
        value: question.selected_month,
      },
      question.default_year ? nil : {
        label: "Year",
        name: "response[year]",
        width: 4,
        value: question.selected_year
      }
    ].compact
  } %>
<% end %>

<%= render "smart_answers/inputs/caption", question: question %>
<%= render "govuk_publishing_components/components/fieldset", {
  legend_text: question.title,
  heading_level: 1,
  heading_size: "l",
  text: form_contents
} %>

<% form_contents = capture do %>
  <% if question.body.present? %>
    <%= question.body %>
  <% end %>

  <%= render "govuk_publishing_components/components/date_input", {
    error_message: question.error,
    hint: question.hint,
    items: [
      question.default_day ? nil : {
        label: "Day",
        name: "response[day]",
        width: 2,
        value: question.selected_day,
      },
      question.default_month ? nil : {
        label: "Month",
        name: "response[month]",
        width: 2,
        value: question.selected_month,
      },
      question.default_year ? nil : {
        label: "Year",
        name: "response[year]",
        width: 4,
        value: question.selected_year
      }
    ].compact
  } %>
<% end %>

<%= render "smart_answers/inputs/caption", question: question %>
<%= render "govuk_publishing_components/components/fieldset", {
  legend_text: question.title,
  heading_level: 1,
  heading_size: "l",
  text: form_contents
} %>

Use hint property for the date input component
Use hint property for the date input component

This re-uses the in-built hint property for the date component instead
of rendering a seperate component.
