diff options
| author | soryu <soryu@soryu.co> | 2025-11-15 18:00:09 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2025-11-15 18:00:09 +0000 |
| commit | 3e7b2beca1136a42700a7e1aebfe4c0fb2861a00 (patch) | |
| tree | 6c896c31820681e360e50a73839fc2284c043dea /frontend/src/components/ChoiceMenu.tsx | |
| download | soryu-3e7b2beca1136a42700a7e1aebfe4c0fb2861a00.tar.gz soryu-3e7b2beca1136a42700a7e1aebfe4c0fb2861a00.zip | |
Initial commit
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> + ) +} |
