From e71917632ccaa5a9765eb6fa5e0c46bbf4de8302 Mon Sep 17 00:00:00 2001 From: Sumanth U <157620444+Sumanth077s@users.noreply.github.com> Date: Thu, 28 Nov 2024 18:42:08 +0530 Subject: [PATCH] Update SetupForm.js --- 23-quiz/final/src/SetupForm.js | 48 +++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/23-quiz/final/src/SetupForm.js b/23-quiz/final/src/SetupForm.js index b3d2e4217..72bfad71e 100644 --- a/23-quiz/final/src/SetupForm.js +++ b/23-quiz/final/src/SetupForm.js @@ -2,64 +2,76 @@ import React from 'react' import { useGlobalContext } from './context' const SetupForm = () => { + // Destructure values from the global context const { quiz, handleChange, handleSubmit, error } = useGlobalContext() + return (
+ {/* Form for setting up the quiz */}

setup quiz

- {/* amount */} + + {/* Input for specifying the number of questions */}
- {/* category */} + {/* Dropdown to select the quiz category */}
- {/* difficulty */} + {/* Dropdown to select the quiz difficulty */}
+ + {/* Error message displayed if there is an issue generating questions */} {error && (

can't generate questions, please try different options

)} -