fix: 선택지가 있는 경우만 선택지 라벨이 나오도록 변경

This commit is contained in:
정기영 2024-08-08 10:31:29 +09:00
parent c7261ae36a
commit 2bc0d7e3e5

View File

@ -3,6 +3,7 @@ import { STATIC_URL } from '../../constants';
export default function QuizCard({ index, question, answer, image, choices }) { export default function QuizCard({ index, question, answer, image, choices }) {
// TODO: / // TODO: /
console.log(choices);
return ( return (
<div className={styles.card}> <div className={styles.card}>
<div className={styles.header}> <div className={styles.header}>
@ -23,7 +24,7 @@ export default function QuizCard({ index, question, answer, image, choices }) {
<div className={styles.input}>{question}</div> <div className={styles.input}>{question}</div>
<label className={styles.label}>정답</label> <label className={styles.label}>정답</label>
<div className={styles.input}>{answer}</div> <div className={styles.input}>{answer}</div>
<label className={styles.label}>선택지</label> {choices.length > 0 && <label className={styles.label}>선택지</label>}
{choices.map?.((choice, idx) => ( {choices.map?.((choice, idx) => (
<div <div
className={styles.choiceDiv} className={styles.choiceDiv}