import React, { useRef } from "react"; type Props = { problemTitle: string; problemDescription: string; onCodeChange: (code: string) => void; onCodeSubmit: (code: string) => void; currentScore: number | null; lastExecStatus: string | null; }; export default function GolfPlayAppGaming({ problemTitle, problemDescription, onCodeChange, onCodeSubmit, currentScore, lastExecStatus, }: Props) { const textareaRef = useRef(null); const handleTextChange = (e: React.ChangeEvent) => { onCodeChange(e.target.value); }; const handleSubmitButtonClick = () => { if (textareaRef.current) { onCodeSubmit(textareaRef.current.value); } }; return (
{problemTitle}
{problemDescription}
Score: {currentScore ?? "-"} ({lastExecStatus ?? "-"})
); }