Add tests and edit works

This commit is contained in:
Joey Yakimowich-Payne 2026-01-13 23:52:04 -07:00
commit bc4b0e2df7
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
12 changed files with 2415 additions and 20 deletions

View file

@ -13,7 +13,7 @@ interface QuizEditorProps {
onSave: (quiz: Quiz) => void;
onStartGame: (quiz: Quiz) => void;
onBack: () => void;
sourceQuizId?: string | null;
showSaveButton?: boolean;
isSaving?: boolean;
}
@ -22,7 +22,7 @@ export const QuizEditor: React.FC<QuizEditorProps> = ({
onSave,
onStartGame,
onBack,
sourceQuizId,
showSaveButton = true,
isSaving
}) => {
const [quiz, setQuiz] = useState<Quiz>(initialQuiz);
@ -146,14 +146,17 @@ export const QuizEditor: React.FC<QuizEditorProps> = ({
</p>
</div>
<button
onClick={() => onSave(quiz)}
disabled={isSaving}
className="bg-white/20 p-2 rounded-full hover:bg-white/30 transition disabled:opacity-50"
title={sourceQuizId ? 'Save changes' : 'Save to library'}
>
<Save size={24} />
</button>
{showSaveButton && (
<button
onClick={() => onSave(quiz)}
disabled={isSaving}
className="bg-white/20 p-2 rounded-full hover:bg-white/30 transition disabled:opacity-50"
title="Save to library"
>
<Save size={24} />
</button>
)}
{!showSaveButton && <div className="w-10" />}
</div>
<div className="absolute -right-10 -top-10 w-40 h-40 bg-white/10 rounded-full"></div>