import * as React from 'react'
import type { Words } from '@lastres/word'
import { StateGame } from '@lastres/components/game'

export interface WordSelectorProps {
    words: Words | null
    setStateGame: (set: StateGame) => void
}

export default function WordSelector (props: WordSelectorProps): JSX.Element {
    const words = props.words

    return (
        <div className="word-selector">
            <a href="#" className="close-button"
                onClick={() => {
                    props.setStateGame(StateGame.MainScreen)
                }}>x</a>
            <h2>Selecciona una palabra.</h2>
        </div>
    )
}
