buttons for canvas preview

This commit is contained in:
2024-09-03 16:12:53 -06:00
parent b07fb335f7
commit 3103ab00ae
2 changed files with 16 additions and 3 deletions

View File

@@ -19,7 +19,6 @@ export default function EditQuiz({
const updateQuizMutation = useUpdateQuizMutation();
const [quizText, setQuizText] = useState(quizMarkdownUtils.toMarkdown(quiz));
const [error, setError] = useState("");
// console.log(quizText);
useEffect(() => {
const delay = 500;
@@ -51,11 +50,16 @@ export default function EditQuiz({
{quiz.name}
<div className="columns-2 min-h-0 flex-1">
<MonacoEditor value={quizText} onChange={setQuizText} />
<div>
<div className="h-full">
<div className="text-red-300">{error && error}</div>
<QuizPreview quiz={quiz} />
</div>
</div>
<div className="p-5">
<button className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Add to canvas....
</button>
</div>
</div>
);
}

View File

@@ -8,7 +8,7 @@ import { markdownToHTMLSafe } from "@/services/htmlMarkdownUtils";
export default function QuizPreview({ quiz }: { quiz: LocalQuiz }) {
return (
<div>
<div style={{ overflow: "scroll", height: "100%" }}>
<div className="columns-2">
<div className="text-end">Name</div>
<div>{quiz.name}</div>
@@ -47,6 +47,15 @@ export default function QuizPreview({ quiz }: { quiz: LocalQuiz }) {
question={question}
/>
))}
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</div>
);
}