<div>
    <form>
        <div class="row mb-3">
            <label class="col-sm-2 col-form-label" for="type">Sertifika Tipi</label>
            <div class="col-sm-10">
                <select class="form-select" id="type" wire:model="type">
                    <option value="">Seçiniz</option>
                    @foreach(\App\Enums\CertificateTypes::cases() as $type)
                        <option value="{{ $type->value }}">{{ $type->getText() }} ({{ $type->getFileType() }})</option>
                    @endforeach
                </select>
                <div>
                    @error('type')
                        <span class="error">{{ $message }}</span>
                    @enderror
                </div>
            </div>
        </div>

        <div class="row mb-3">
            <label class="col-sm-2 col-form-label" for="file">Dosya (Sertifika)</label>
            <div class="col-sm-10">
                <input class="form-control" id="file" type="file" wire:model="file">
                <div>
                    @error('file')
                        <span class="error">{{ $message }}</span>
                    @enderror
                </div>
            </div>
        </div>

        <button class="btn btn-primary" type="submit" wire:click.prevent="saveAndRedirect" wire:loading.attr="disabled" wire:target="file, save, saveAndRedirect" wire:loading.class="disabled">
            Kaydet
        </button>

        <button class="btn btn-primary" type="submit" wire:click.prevent="save" wire:loading.attr="disabled" wire:target="file, save, saveAndRedirect" wire:loading.class="disabled">
            Kaydet ve Eklemeye Devam Et
        </button>
    </form>
</div>
