import { Game } from "@/types/stellaris"; import { Dropdown } from "@nextui-org/react"; import { Dispatch, Key, SetStateAction, useState } from "react"; type SelectionType = "all" | Set; export const GameSelect = (props: { games: Game[], currentGame: Game | undefined, setCurrentGame: Dispatch> }) => { const changeSelection = (keys: SelectionType) => { if (keys != "all") { props.games.forEach(game => { if (game.name == keys.keys().next().value) [ props.setCurrentGame(game) ] }) } } return ( {props.currentGame ? props.currentGame.name : "-"} {props.games.map((item) => ( {item.name} ))} ) }