<h4 class="c-grey-900 mT-10 mB-30">{{ $submitLabel }}</h4>

<div class="bgc-white bd bdrs-3 p-20 mB-20">
    <!-- Name -->
    <div class="mb-3">
        <label for="name" class="form-label">Category Name</label>
        <input type="text" name="name" id="name" class="form-control @error('name') is-invalid @enderror" placeholder="Enter category name" value="{{ old('name', $productCategory->name ?? '') }}">
        @error('name')
        <div class="text-danger">{{ $message }}</div>
        @enderror
    </div>

    <!-- Icon Picker -->
    <div class="form-group mb-3">
        <div class="row">
            <div class="col-md-6">
                <label for="icon" class="form-label">Select Icon</label>
                <input id="icon" name="icon" type="text" class="form-control @error('icon') is-invalid @enderror" value="{{ old('icon', $productCategory->icon ?? '') }}">
                @error('icon')
                <div class="invalid-feedback">{{ $message }}</div>
                @enderror
            </div>
            <div class="col-md-6">
                <label for="icon" class="form-label">Selected Icon</label>
                <div class="selected-icon mt-2"></div>
            </div>
        </div>
    </div>

    <!-- Description -->
    <div class="mb-3">
        <label for="description" class="form-label">Description</label>
        <textarea name="description" id="description" class="form-control @error('description') is-invalid @enderror" placeholder="Enter category description">{{ old('description', $productCategory->description ?? '') }}</textarea>
        @error('description')
        <div class="text-danger">{{ $message }}</div>
        @enderror
    </div>

    <!-- Action Buttons -->
    <div>
        <a href="{{ route('ch-admin.categories.index') }}" class="btn btn-secondary">Cancel</a>
        <button type="submit" class="btn btn-primary">{{ $submitLabel }}</button>
    </div>
</div>

<!-- Add Icon Picket Script Code -->
@push('scripts')
    <script src="https://unpkg.com/codethereal-iconpicker@1.2.1/dist/iconpicker.js"></script>
    <script src="{{ url('assets/backend/js/iconPicker.js') }}"></script>
@endpush
