<div class="row">
    <x-title>
        Edit Institution: {{ $display_name }}
    </x-title>

    <div class="col-12 col-md-4"></div>
    <div class="col-12 col-md-4">
        <div class="card">
            <div class="card-body">
                <form method="POST" wire:submit.prevent="saveInstitution">
                    <x-ui.input name="display_name" label="Display Name"/>

                    <x-ui.select :options="$dsar_types" label="DSAR Type" name="dsar_type_id"/>

                    <x-ui.select :options="[null => 'None', 'email' => 'Email', 'post' => 'Post', 'both' => 'Both']" label="DSAR Send Type" name="send_type"/>

                    <div class="mb-3">
                        <label class="form-label fw-semibold" for="stated_sar_backlog">
                            Stated SAR Backlog
                        </label>
                        <input type="number" min="0"
                               id="stated_sar_backlog"
                               class="form-control"
                               wire:model.defer="stated_sar_backlog"
                               placeholder="e.g. 850">
                        @error('stated_sar_backlog')
                            <div class="text-danger small mt-1">{{ $message }}</div>
                        @enderror
                        <small class="text-muted">
                            Number of outstanding SARs this institution has publicly reported. Used on the DSAR report to predict response times.
                        </small>
                    </div>

                    <div class="mb-3">
                        <div class="form-check form-switch">
                            <input class="form-check-input"
                                   type="checkbox"
                                   id="is_prioritised"
                                   wire:model="is_prioritised">
                            <label class="form-check-label fw-semibold" for="is_prioritised">
                                Global
                            </label>
                        </div>
                        <small class="text-muted">Global institutions appear at the top of the DSAR creation list.</small>
                    </div>

                    <button class="btn btn-success">
                        Save
                    </button>
                </form>
            </div>
        </div>
    </div>
</div>
