'use client'

import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from '@/components/ui/select'
import { HARDCODED_DISCIPLINES, HardcodedDiscipline } from './discipline-data'

export interface DisciplineHardcodedSelectorProps {
  selectedDiscipline?: string
  onDisciplineSelect: (discipline: string) => void
  disabled?: boolean
  placeholder?: string
  className?: string
}

export function DisciplineHardcodedSelector({ 
  selectedDiscipline, 
  onDisciplineSelect, 
  disabled,
  placeholder = "설계공종 선택",
  className
}: DisciplineHardcodedSelectorProps) {
  
  return (
    <Select
      value={selectedDiscipline}
      onValueChange={onDisciplineSelect}
      disabled={disabled}
    >
      <SelectTrigger className={`w-full ${className || ''}`}>
        <SelectValue placeholder={placeholder}>
          {selectedDiscipline || <span className="text-muted-foreground">{placeholder}</span>}
        </SelectValue>
      </SelectTrigger>
      <SelectContent>
        {HARDCODED_DISCIPLINES.map((discipline) => (
          <SelectItem key={discipline} value={discipline}>
            {discipline}
          </SelectItem>
        ))}
      </SelectContent>
    </Select>
  )
}
