sozsoft-platform/ui/src/components/classroom/planning/ClassroomSelector.tsx
Sedat Öztürk 429227df1d Initial
2026-02-24 23:44:16 +03:00

31 lines
969 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { Classroom } from '@/proxy/classroom/planning'
import React from 'react'
import { classrooms } from '../data/classroom'
interface ClassroomSelectorProps {
selectedClassroom: Classroom | null
onClassroomChange: (classroom: Classroom | null) => void
}
export const ClassroomSelector: React.FC<ClassroomSelectorProps> = ({
selectedClassroom,
onClassroomChange,
}) => {
return (
<div className="w-full">
<select
id="classroom-selector"
value={selectedClassroom?.id || ''}
onChange={(e) => onClassroomChange(classrooms.find((c) => c.id === e.target.value) || null)}
className="w-full px-2 py-1 border border-gray-300 rounded"
>
<option value="">Sınıf seçin...</option>
{classrooms.map((classroom) => (
<option key={classroom.id} value={classroom.id}>
{classroom.name} {classroom.capacity} koltuk
</option>
))}
</select>
</div>
)
}