import { Button, DialogActions, DialogContent, DialogContentText, DialogTitle, TextField, } from '@mui/material'; import { FormEvent } from 'react'; const placeholder = `Player 1 Player 2 Player 3 Player 4 ...`; export default function ManualNamesForm({ close, manualNames, setManualNames, }: { close: () => void; manualNames: string[]; setManualNames: (manualNames: string[]) => Promise; }) { return ( <> Enter Player Names
) => { const target = event.target as typeof event.target & { names: { value: string }; }; const rawNames = target.names.value; event.preventDefault(); event.stopPropagation(); if (rawNames) { await setManualNames(rawNames.split('\n')); close(); } }} > One per line 0 ? manualNames.join('\n') : undefined } />
); }