website

source code for the ttmaths.uk website
Log | Files | Refs | README

Question.jsx (341B)


      1 import Equation from './Equation.jsx';
      2 
      3 function maybeEquation(expression) {
      4   if (typeof expression == 'string') return <Equation equation={expression} />;
      5   return expression;
      6 }
      7 
      8 export default function Question({ question, answer, showAnswer }) {
      9   return (
     10     <li>
     11       {maybeEquation(showAnswer ? answer : question)}
     12     </li>
     13   );
     14 }