import type { QuizQuestion, Word } from '../api/request'

export function spellQuestionFromWord(word: Word): QuizQuestion {
  const zh = word.source_lang === 'zh' ? word.source_text : word.target_text
  const en = word.source_lang === 'zh' ? word.target_text : word.source_text
  return {
    word_id: word.id,
    question_type: 'spell',
    prompt: zh,
    phonetic: word.phonetic,
    options: [],
    correct_answer: en,
  }
}
