@extends('layouts.app')
@section('title', __('vrc::lang.categories'))
@section('content')
<section class="content-header"><h1>@lang('vrc::lang.service_categories')</h1></section>
<section class="content">
    @component('components.widget', ['class' => 'box-primary'])
        @slot('tool')
            <div class="box-tools"><button class="btn btn-primary vrc-modal-btn" data-href="{{ route('vrc.service-categories.create') }}"><i class="fa fa-plus"></i> @lang('messages.add')</button></div>
        @endslot
        <div class="table-responsive">
            <table class="table table-bordered table-striped" id="vrc_cats_table">
                <thead><tr>
                    <th>@lang('vrc::lang.category')</th><th>(AR)</th><th>@lang('vrc::lang.services')</th><th>@lang('vrc::lang.status')</th><th>@lang('messages.action')</th>
                </tr></thead>
            </table>
        </div>
    @endcomponent
    <div class="modal fade vrc_modal" tabindex="-1" role="dialog"></div>
</section>
@endsection
@section('javascript')
<script>
$(function () {
    var table = $('#vrc_cats_table').DataTable({
        processing: true, serverSide: true, ajax: '{{ route('vrc.service-categories.index') }}',
        columns: [
            { data: 'name', name: 'name' },
            { data: 'name_ar', name: 'name_ar', defaultContent: '—' },
            { data: 'services_count', name: 'services_count', orderable: false, searchable: false },
            { data: 'is_active', name: 'is_active', orderable: false },
            { data: 'action', name: 'action', orderable: false, searchable: false },
        ],
    });
    window.__vrcTables = window.__vrcTables || []; window.__vrcTables.push(table);
});
</script>
@include('vrc::partials.crud_scripts')
@endsection
