자료관 DC서비스 추가
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@common/components";
|
||||
|
||||
type CodeSelectProps = {
|
||||
value?: string;
|
||||
onValueChange?: (value: string) => void;
|
||||
options: { value: string; label: string }[];
|
||||
placeholder?: string;
|
||||
className?: string;
|
||||
disabled?: boolean;
|
||||
};
|
||||
|
||||
export function CodeSelect({
|
||||
value,
|
||||
onValueChange,
|
||||
options,
|
||||
placeholder = "선택",
|
||||
className,
|
||||
disabled = false,
|
||||
}: CodeSelectProps) {
|
||||
return (
|
||||
<Select value={value ?? ""} onValueChange={onValueChange} disabled={disabled}>
|
||||
<SelectTrigger className={className}>
|
||||
<SelectValue placeholder={placeholder} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="__SELECT__">선택</SelectItem>
|
||||
{options.map((option) => (
|
||||
<SelectItem key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user