<x-app-layout>
    <x-slot name="header">
            {{ __('Transaction History') }}
    </x-slot>

    <div class="py-6">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
            <div class="bg-white overflow-hidden shadow-xl sm:rounded-lg">
                <div class="p-6 sm:px-20 bg-white border-b border-gray-200">

                    <div class="mb-6">
                     @livewire('side-post', [
                        'type' => 'SiteContents\Transactions' ?? null,
                        'latest' => true,
                        'fallbackTitle' => '',
                        'fallbackDescription' => ''])
                    </div>

                    <!--- Change account -->
                    @livewire('from-account', ['label' => __('Select account'), 'active' => false])

                    <!--- Extend this div horizontally to fit the entire white container -->
                    <div class="border-b border-theme-primary bg-theme-background mb-0 mt-12 -mx-6 sm:-mx-20"></div>
                    
                    <!-- Table title -->
                    @livewire('table-title')

                    <!-- Balance limits --->
                    @livewire('account-usage-bar')

                    <!--- Transactions table -->
                    @livewire('transactions-table')

                </div>
            </div>
        </div>

    @if(request()->query('openAccountUsageInfo') === 'true')
        <script>
            document.addEventListener('livewire:initialized', function() {
                setTimeout(function() {
                    Livewire.dispatch('openAccountUsageInfoModal');
                }, 500);
            });
        </script>
    @endif

</x-app-layout>

