import styles from '../Select/Select.module.css';

export const Select = ({ label, options, value, onChange }) => {
  return (
    <div className={styles.container}>
      {label && <label className={styles.label}>{label}</label>}
      <select className={styles.select} value={value} onChange={onChange} >
        {options.map((opt, index) => (
          <option key={index} value={opt.value} className={styles.option}>
            {opt.label}
          </option>
        ))}
      </select>
    </div>
  );
};
