diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-25 22:04:56 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-25 22:04:56 +0900 |
| commit | 2b59582194fc5c23140f52c42c793c324856a35e (patch) | |
| tree | 0db8ef0e913b3a44dfd6e3e20fe92b8e4984aeba /components/common/discipline-hardcoded/discipline-hardcoded-selector.tsx | |
| parent | 835df8ddc115ffa74414db2a4fab7efc0d0056a9 (diff) | |
(김준회) 벤더풀&AVL 구매 추가요청사항 반영
Diffstat (limited to 'components/common/discipline-hardcoded/discipline-hardcoded-selector.tsx')
| -rw-r--r-- | components/common/discipline-hardcoded/discipline-hardcoded-selector.tsx | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/components/common/discipline-hardcoded/discipline-hardcoded-selector.tsx b/components/common/discipline-hardcoded/discipline-hardcoded-selector.tsx new file mode 100644 index 00000000..6de0a285 --- /dev/null +++ b/components/common/discipline-hardcoded/discipline-hardcoded-selector.tsx @@ -0,0 +1,48 @@ +'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> + ) +} |
