| 1 | import 'react' |
| 2 | import './menu.css' |
| 3 | import type { ReactElement, JSX } from 'react' |
| 4 | |
| 5 | export interface MenuProps { |
| 6 | onClick(arg: string): void |
| 7 | panel: string |
| 8 | options: string[] |
| 9 | logo?: JSX.Element |
| 10 | } |
| 11 | |
| 12 | export function Menu ({ onClick, panel, options, logo }: MenuProps): ReactElement { |
| 13 | return ( |
| 14 | <div className='Menu'> |
| 15 | {logo} |
| 16 | { |
| 17 | options.map(option => ( |
| 18 | <button key={option} onClick={() => { onClick(option) }} className={panel === option ? 'selected' : ''}>{option}</button> |
| 19 | )) |
| 20 | } |
| 21 | </div> |
| 22 | ) |
| 23 | } |