<PhoenixKitWeb.Components.LayoutWrapper.app_layout
  socket={@socket}
  flash={@flash}
  phoenix_kit_current_scope={assigns[:phoenix_kit_current_scope]}
  page_title={gettext("Dashboard")}
  page_subtitle={
    if @can_access_admin_area? do
      gettext("Welcome to the %{project_title} administration panel",
        project_title: @project_title
      )
    end
  }
  current_path={@url_path}
  project_title={@project_title}
  current_locale={@current_locale}
>
  <div class="px-4 py-8">
    <%!-- The welcome half: ungated, and therefore the whole page for a visitor
         holding no permissions. --%>
    <.welcome_block scope={assigns[:phoenix_kit_current_scope]} greeting={@greeting_key} />

    <%!-- The operator half. Renders nothing at all when every block is gated
         off, so the `mt-8` gap exists only when there is something below. --%>
    <PhoenixKitWeb.Components.Core.DashboardOverview.dashboard_overview
      class="mt-8"
      show_users_card={@show_users_card}
      show_roles_card={@show_roles_card}
      show_sessions_card={@show_sessions_card}
      show_live_activity_card={@show_live_activity_card}
      show_add_user_card={@show_add_user_card}
      show_email_card={@show_email_card}
      show_statistics={@show_statistics}
      stats={@stats}
      session_stats={@session_stats}
      presence_stats={@presence_stats}
      phoenix_kit_version={@phoenix_kit_version}
      migration_current={@migration_current}
      migration_db={@migration_db}
    />
  </div>
</PhoenixKitWeb.Components.LayoutWrapper.app_layout>
