@props([
    'title',
    'subtitle' => null,
    'pageIcon' => 'fe fe-grid',
    'breadcrumbs' => [],
    'documentTitle' => null,
    'badges' => [],
    'summaries' => [],
])

<x-ui.layout.app
    :title="$documentTitle ?? $title"
    :pageTitle="$title"
    :pageIcon="$pageIcon"
    :breadcrumbs="$breadcrumbs"
>
    <x-slot name="contextToolbar">
        @isset($actions)
            <div class="d-flex flex-wrap gap-2 align-items-center">
                {{ $actions }}
            </div>
        @endisset
    </x-slot>

    <div class="container-fluid py-4">
        <x-ui.layout.page-header
            :title="$title"
            :subtitle="$subtitle"
            :badges="$badges"
            :summaries="$summaries"
            :show-heading="false"
            :show-actions="false"
        >
        </x-ui.layout.page-header>

        <x-ui.layout.flash />

        <x-ui.operational.speed-client />

        @if (session()->has('support_impersonation'))
            <div class="alert alert-warning d-flex flex-wrap align-items-center justify-content-between gap-2 mb-3">
                <span class="small mb-0">{{ __('operations.impersonation') }}</span>
                <form method="post" action="{{ route('support.impersonation.end') }}" class="mb-0">
                    @csrf
                    <button type="submit" class="btn btn-sm btn-outline-dark">{{ __('operations.end_impersonation') }}</button>
                </form>
            </div>
        @endif

        {{ $slot }}
    </div>
</x-ui.layout.app>
