/* global React */ (function () { const T = window.SC_T; function QuestionCard({ question, index, total, onAnswer }) { const [text, setText] = React.useState(''); React.useEffect(() => setText(''), [question]); const submit = () => onAnswer(text.trim()); const handleKey = (e) => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); submit(); } }; return (
{index + 1} / {total}
{question}