import React, { useState } from 'react'; export interface ButtonGroupProps { choices: string[]; label?: string; default?: string; onchange: (value: string) => void; } export const ButtonGroup: React.FC = ({ choices, label = '', default: initial, onchange }) => { const [selected, setSelected] = useState(initial ?? choices[0]); const handleClick = (choice: string) => { setSelected(choice); onchange(choice); }; return (
{label && }
{choices.map((choice) => ( ))}
); };