<%= GovukPublishingComponents::AppHelpers::TableHelper.helper(self, "Children", { caption_classes: "govuk-heading-m" }) do |table| %>

  <%= table.head do %>
    <%= table.header "Title" %>
    <%= table.header "Status" %>
    <%= table.header "Actions" if gds_editor? %>
  <% end %>

  <%= table.body do %>
    <% page.sorted_children.each do |child_page| %>
      <%= table.row do %>
        <%= table.cell render "govuk_publishing_components/components/document_list", {
          remove_top_border: true,
          items: [
            {
              link: {
                text: child_page.title,
                path: child_page
              },
              metadata: {
                preview_link: link_to(child_page.base_path, Plek.new.website_root + child_page.base_path, target: "_blank", class: "govuk-link")
              },
              edit:  {
                href: edit_polymorphic_path(page),
                link_text: "Edit page"
              }
            }
          ]
        } %>

        <%= table.cell govuk_status(child_page) %>
        <%= table.cell link_to('Edit', edit_polymorphic_path(child_page), class: "govuk-link") if gds_editor? %>
      <% end %>
    <% end %>
  <% end %>

<% end %>

<%= render "govuk_publishing_components/components/heading", {
  text: "Children",
  margin_bottom: 3,
} %>

<% if page.sorted_children.any? %>

  <%= GovukPublishingComponents::AppHelpers::TableHelper.helper(self, "Children", { caption_classes: "govuk-visually-hidden" }) do |table| %>

    <%= table.head do %>
      <%= table.header "Title" %>
      <%= table.header "Status" %>
      <%= table.header "Actions" if gds_editor? %>
    <% end %>

    <%= table.body do %>
      <% page.sorted_children.each do |child_page| %>
        <%= table.row do %>
          <%= table.cell render "govuk_publishing_components/components/document_list", {
            remove_top_border: true,
            items: [
              {
                link: {
                  text: child_page.title,
                  path: child_page
                },
                metadata: {
                  preview_link: link_to(child_page.base_path, Plek.new.website_root + child_page.base_path, target: "_blank", class: "govuk-link")
                },
                edit:  {
                  href: edit_polymorphic_path(page),
                  link_text: "Edit page"
                }
              }
            ]
          } %>

          <%= table.cell govuk_status(child_page) %>
          <%= table.cell link_to('Edit', edit_polymorphic_path(child_page), class: "govuk-link") if gds_editor? %>
        <% end %>
      <% end %>
    <% end %>

  <% end %>

<% else %>
  <p class="govuk-body">No children has been added for this page</p>
<% end %>

Add empty state message for child list
Add empty state message for child list

Previously any empty table was show which was not very nice visually, now it shows a message.
