<x-app-layout>
    <x-slot name="header">{{ __('Edit Vendor') }}: {{ $vendor->name }}</x-slot>

    <div class="card shadow-sm" style="max-width:600px">
        <div class="card-body">
            <form action="{{ route('vendors.update', $vendor) }}" method="POST">
                @csrf @method('PUT')
                <div class="mb-3">
                    <label class="form-label" for="name">{{ __('Vendor Name') }} <span class="text-danger">*</span></label>
                    <input id="name" type="text" name="name" class="form-control @error('name') is-invalid @enderror"
                           value="{{ old('name', $vendor->name) }}" required>
                    @error('name')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
                <div class="mb-3">
                    <label class="form-label" for="phone">{{ __('Phone') }}</label>
                    <input id="phone" type="text" name="phone" class="form-control"
                           value="{{ old('phone', $vendor->phone) }}">
                </div>
                <div class="mb-3">
                    <label class="form-label" for="address">{{ __('Address') }}</label>
                    <textarea id="address" name="address" class="form-control" rows="2">{{ old('address', $vendor->address) }}</textarea>
                </div>
                <div class="mb-3 form-check">
                    <input id="is_active" type="checkbox" name="is_active" value="1" class="form-check-input"
                        {{ old('is_active', $vendor->is_active) ? 'checked' : '' }}>
                    <label class="form-check-label" for="is_active">{{ __('Active') }}</label>
                </div>
                <button type="submit" class="btn btn-primary">{{ __('Update Vendor') }}</button>
                <a href="{{ route('vendors.index') }}" class="btn btn-secondary">{{ __('Cancel') }}</a>
            </form>
        </div>
    </div>
</x-app-layout>
