<div {{ $attributes->merge(['class' => 'space-y-4']) }}>
    {{-- 选择老师 --}}
    <div class="form-control w-full">
        <label class="label">
            <span class="label-text font-medium">
                {{ $getTeacherLabel() }}
                @if($isRequired())
                    <span class="text-error">*</span>
                @endif
            </span>
        </label>
        <select
            wire:model.live="{{ $getStatePath() }}_teacher"
            class="select select-bordered w-full"
            {{ $isRequired() ? 'required' : '' }}
        >
            <option value="">{{ $getTeacherPlaceholder() }}</option>
            @foreach($getTeacherOptions() as $teacherId => $teacherName)
                <option value="{{ $teacherId }}">{{ $teacherName }}</option>
            @endforeach
        </select>
        @if($getTeacherHelperText())
            <label class="label">
                <span class="label-text-alt text-info">{{ $getTeacherHelperText() }}</span>
            </label>
        @endif
    </div>

    {{-- 选择学生 --}}
    <div class="form-control w-full">
        <label class="label">
            <span class="label-text font-medium">
                {{ $getStudentLabel() }}
                @if($isRequired())
                    <span class="text-error">*</span>
                @endif
            </span>
        </label>
        <select
            wire:model="{{ $getStatePath() }}_student"
            class="select select-bordered w-full"
            @if($isTeacherFilterEnabled() && empty($getState())) disabled @endif
            {{ $isRequired() ? 'required' : '' }}
        >
            <option value="">
                @if($isTeacherFilterEnabled() && empty($getState()))
                    请先选择老师
                @else
                    {{ $getStudentPlaceholder() }}
                @endif
            </option>
            @if($isTeacherFilterEnabled() && !empty($getState()))
                @foreach($getStudentOptions($getState()) as $studentId => $studentName)
                    <option value="{{ $studentId }}">{{ $studentName }}</option>
                @endforeach
            @elseif(!$isTeacherFilterEnabled())
                @foreach($getStudentOptions() as $studentId => $studentName)
                    <option value="{{ $studentId }}">{{ $studentName }}</option>
                @endforeach
            @endif
        </select>
        @if($getStudentHelperText())
            <label class="label">
                <span class="label-text-alt text-info">{{ $getStudentHelperText() }}</span>
            </label>
        @endif
        @if($isTeacherFilterEnabled() && !empty($getState()) && empty($getStudentOptions($getState())))
            <label class="label">
                <span class="label-text-alt text-warning">该老师暂无学生</span>
            </label>
        @endif
    </div>

    {{-- 隐藏的输入字段，用于存储实际值 --}}
    <input type="hidden" name="{{ $getStatePath() }}_teacher" value="{{ $getState() }}" />
    <input type="hidden" name="{{ $getStatePath() }}_student" value="{{ $getState() }}" />
</div>