import { withClasses } from '../utils.jsx'

export const CompoundButton = ({ options, value, setValue }) => {
    return (
        <div class="compound">
            {options.map(option => (
                <button
                    class={withClasses(['radio', option.value === value && 'selected'])}
                    onClick={() => setValue(option.value)}
                >
                    {option.label}
                </button>
            ))}
        </div>
    )
}
