import { Show, createSignal } from "solid-js"; import { Button } from "@/components/ui/button"; import { IconCheck, IconCopy, IconPlus } from "@/components/ui/icons"; import { useT } from "@/stores/preferences-context"; /** One AI-generated practice question with its range-bounded answer. */ export function GeneratedQuestionCard(props: { index: number; question: string; answer: string; /** Absent when the school has no question bank. */ onAddToBank?: () => void; }) { const t = useT(); const [open, setOpen] = createSignal(false); const [copied, setCopied] = createSignal(false); const copy = async () => { try { await navigator.clipboard.writeText(`${props.question}\n\n${props.answer}`); setCopied(true); window.setTimeout(() => setCopied(false), 1500); } catch { // Clipboard can be blocked (insecure origin, permissions); nothing to undo. } }; return (
  • {props.index + 1}

    {props.question}

    {props.answer}

  • ); }