import * as React from "react"; import { FunctionComponent } from "react"; import { Menu, MenuItem } from "@szhsin/react-menu"; import { MancalaGame } from "mancala.js"; import { Context } from "../context/context"; import { getColorByBrightness } from "../util/ColorUtil"; import Button from "./Button"; import "@szhsin/react-menu/dist/index.css"; import "@szhsin/react-menu/dist/transitions/slide.css"; import HeaderbarIcon from "./headerbar/HeaderbarIcon"; import HeaderbarTitle from "./headerbar/HeaderbarTitle"; import Row from "./Row"; import ThemeSwitchMenu from "./headerbar/ThemeSwitchMenu"; function renderNewGameButton( context: Context, game: MancalaGame | undefined, onNewGameClick: () => void, userKeyWhoLeave: string | undefined, crashMessage: string | undefined): JSX.Element { const newGame = (