import React, { useState } from 'react'; export interface SelectProps { choices: string[]; label?: string; default?: string; onchange: (value: string | string[]) => void; } export const Select: React.FC = ({ choices, label = '', default: initial, onchange }) => { const [value, setValue] = useState(initial ?? choices[0]); const handleChange = (e: React.ChangeEvent) => { const newValue = e.target.value; setValue(newValue); onchange(newValue); }; return (
{label && }
); };