@props([])
@php
$g = $grid ?? [];
$filters = $g['filters'] ?? [];
$exports = $g['exports'] ?? [];
$bulkActions = $g['bulk_actions'] ?? [];
$empty = $g['empty'] ?? [];
$hasRows = $g['has_rows'];
$showEmpty = $hasRows === false;
@endphp
@if (! $showEmpty)
@include('components.loan.data-grid.partials.filter-bar', ['g' => $g, 'filters' => $filters])
@include('components.loan.data-grid.partials.toolbar', ['g' => $g, 'exports' => $exports])
@if (($g['selectable'] ?? false) && count($bulkActions) > 0)
@include('components.loan.data-grid.partials.bulk-bar', ['g' => $g, 'bulkActions' => $bulkActions])
@endif
@if (! empty($g['row_hint']))
{{ $g['row_hint'] }}
@endif
@endif
@include('components.loan.data-grid.partials.loading-overlay')
@if (! $showEmpty && (isset($header) || ! empty($g['table_title'])))
@endif
@if (! $showEmpty)
@isset($toolbar)
{{ $toolbar }}
@endisset
@php
$columnStorageKey = (string) ($g['storage_key'] ?? $g['key'] ?? 'data-grid');
$stickyColumn = (string) ($g['sticky_column'] ?? 'first');
$tableStickyClass = match ($stickyColumn) {
'name' => 'ws-table--sticky-name',
'none' => '',
default => 'ws-table--sticky-first',
};
@endphp
@isset($mobile)
{{ $mobile }}
@endisset
@endif
@if ($showEmpty)
@endif
@if (($g['show_pagination'] ?? false) && ! empty($g['pagination_html']))
@include('components.loan.data-grid.partials.pagination', ['html' => $g['pagination_html']])
@elseif (isset($footer))
{{ $footer }}
@endif