@props([ 'box_style' => 'default', 'header' => false, 'top_submit' => false, 'sr_only_title' => false, ]) @aware(['name', 'route'])
merge(['class' => 'box box-'.$box_style]) }}> @if ($header || $top_submit)
@if ($top_submit || isset($header_right)) {{-- Two-column header shape: title on the left, a right- aligned control on the right. `top_submit` bakes in a Save button. The `header_right` slot lets you supply any other right-aligned control (filter dropdown, quick action, etc.). Title truncates with an ellipsis so a long display_name can't push the right-hand element off the row. --}}
@if ($header)

{{ $header }}

@endif
@if ($top_submit) @else
{{ $header_right }}
@endif
@else

{{ $header }}

@endif
@endif
@if (isset($table_header))

{{ $table_header }}

@endif @if (isset($bulkactions))
{{ $bulkactions }}
@endif {{-- Render slot unconditionally — ComponentSlot::isEmpty() materializes the slot to inspect it, doubling every DB call inside. An empty slot renders nothing visible. --}} {{ $slot }}
@if (isset($customfooter)) {{ $customfooter }} @elseif ($route) @endif