diff options
Diffstat (limited to 'frontend/src/components/ChoiceMenu.tsx')
| -rw-r--r-- | frontend/src/components/ChoiceMenu.tsx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/frontend/src/components/ChoiceMenu.tsx b/frontend/src/components/ChoiceMenu.tsx new file mode 100644 index 0000000..0de86f6 --- /dev/null +++ b/frontend/src/components/ChoiceMenu.tsx @@ -0,0 +1,20 @@ +import React from 'react' +import { Choice } from '../types' + +type Props = { + choices: Choice[] + onSelect: (id: string) => void +} + +export const ChoiceMenu: React.FC<Props> = ({ choices, onSelect }) => { + if (!choices.length) return null + return ( + <div className="choice-menu"> + {choices.map((c) => ( + <button key={c.id} className="choice-item" onClick={() => onSelect(c.id)}> + {c.label} + </button> + ))} + </div> + ) +} |
