import { useState } from 'react'; interface GameFormData { gameInternalName: string; gameFormattedName: string; gameDescription: string; } interface GameManagerProps { onGameSubmit: (formData: GameFormData) => Promise; isSubmitting: boolean; } const GameManager = ({ onGameSubmit, isSubmitting }: GameManagerProps) => { const [formData, setFormData] = useState({ gameInternalName: '', gameFormattedName: '', gameDescription: '' }); const handleInputChange = (e: React.ChangeEvent) => { const { name, value } = e.target; setFormData(prev => ({ ...prev, [name]: value })); }; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (!formData.gameInternalName || !formData.gameFormattedName || !formData.gameDescription) { alert('Please fill in all fields'); return; } await onGameSubmit(formData); // Reset form after successful submission setFormData({ gameInternalName: '', gameFormattedName: '', gameDescription: '' }); }; return ( <>

This form allows you to add a new game to Mirage. By default, Mirage will attempt to derive a method of showing the game's score on its own. You may override this behavior by writing your own custom score display logic.

); }; export default GameManager;