{{-- Dental specialty fields, injected into ClinicCore's patient form via the
     SpecialtyDriverRegistry. Receives $patient (ClcPatient|null). The tooth
     chart itself is recorded on the patient show screen. --}}
@php
    $dentalProfile = (isset($patient) && $patient)
        ? \Modules\DentalClinic\Entities\DentalPatientProfile::where('clc_patient_id', $patient->id)->first()
        : null;
    $dentition = old('dentition_type', $dentalProfile->dentition_type ?? 'adult');
    $dentalNotes = old('dental_notes', $dentalProfile->notes ?? '');
@endphp
<div class="row">
    <div class="col-md-12"><h5 style="margin:6px 0;"><i class="fas fa-tooth text-info"></i> Dental</h5><hr style="margin:4px 0 12px;"></div>
    <div class="col-md-4">
        <div class="form-group">
            <label>Dentition</label>
            <select name="dentition_type" class="form-control">
                @foreach(['adult'=>'Adult (permanent)','child'=>'Child (primary)','mixed'=>'Mixed'] as $val => $lbl)
                    <option value="{{ $val }}" {{ (string)$dentition === (string)$val ? 'selected' : '' }}>{{ $lbl }}</option>
                @endforeach
            </select>
        </div>
    </div>
    <div class="col-md-8">
        <div class="form-group">
            <label>Dental notes</label>
            <input type="text" name="dental_notes" class="form-control" value="{{ $dentalNotes }}" placeholder="Orthodontics, prosthetics, occlusion…">
        </div>
    </div>
</div>
