@php $title = __('organization.entities.'.$entity); @endphp
<x-ui.layout.page :title="$title" page-icon="fe fe-grid"><x-ui.operational.index-shell>
<x-slot:toolbar><x-ui.operational.create-button :href="route('hr.'.$route.'.create')" :label="__('organization.actions.add')" :permission="$route.'.create'" /></x-slot:toolbar>
<x-ui.table.table :columns="[['label'=>__('organization.fields.code')],['label'=>__('organization.fields.name')],['label'=>__('organization.fields.status')],['label'=>__('common.actions'),'align'=>'end']]">
@forelse($records as $record)<x-ui.table.row><td>{{ $record->code }}</td><td><strong>{{ $record->name }}</strong></td><td>{{ $record->is_active ? __('organization.status.active') : __('organization.status.inactive') }}</td>
<td class="text-end"><div class="d-inline-flex gap-2"><x-ui.buttons.secondary size="sm" :href="route('hr.'.$route.'.edit',$record)">{{ __('common.edit') }}</x-ui.buttons.secondary>
@if($record->is_active)<form method="POST" action="{{ route('hr.'.$route.'.deactivate',$record) }}">@csrf <x-ui.buttons.danger outline size="sm" type="submit">{{ __('organization.actions.deactivate') }}</x-ui.buttons.danger></form>@endif</div></td></x-ui.table.row>
@empty<x-ui.table.row><td colspan="4">{{ __('organization.empty') }}</td></x-ui.table.row>@endforelse</x-ui.table.table></x-ui.operational.index-shell></x-ui.layout.page>