You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
481 B
JavaScript
17 lines
481 B
JavaScript
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>
|
|
)
|
|
}
|