|
1 | | -import { Documento } from "./documento"; |
| 1 | +"use client"; |
| 2 | + |
| 3 | +import { useState } from "react"; |
2 | 4 | import { Texto } from "./texto"; |
| 5 | +import { Documento } from "./documento"; |
| 6 | +import { Audio } from "./audio"; |
| 7 | + |
| 8 | +type GenerationMode = "text" | "document" | "audio" | null; |
| 9 | + |
| 10 | +interface AutomaticQuestionsProps { |
| 11 | + onQuestionsGenerated: (questions: { |
| 12 | + text: string; |
| 13 | + alternatives: { |
| 14 | + text: string; |
| 15 | + correct: boolean; |
| 16 | + explanation: string; |
| 17 | + }[]; |
| 18 | + }[]) => void; |
| 19 | + themeId: string; |
| 20 | + subTopicId: string; |
| 21 | +} |
| 22 | + |
| 23 | +export default function AutomaticQuestions({ onQuestionsGenerated, themeId, subTopicId }: AutomaticQuestionsProps) { |
| 24 | + const [mode, setMode] = useState<GenerationMode>(null); |
| 25 | + |
| 26 | + if (mode === "text") { |
| 27 | + return ( |
| 28 | + <Texto |
| 29 | + onBack={() => setMode(null)} |
| 30 | + onQuestionsGenerated={onQuestionsGenerated} |
| 31 | + themeId={themeId} |
| 32 | + subTopicId={subTopicId} |
| 33 | + /> |
| 34 | + ); |
| 35 | + } |
| 36 | + |
| 37 | + if (mode === "document") { |
| 38 | + return <Documento onBack={() => setMode(null)} />; |
| 39 | + } |
| 40 | + |
| 41 | + if (mode === "audio") { |
| 42 | + return <Audio onBack={() => setMode(null)} />; |
| 43 | + } |
3 | 44 |
|
4 | | -export default function AutomaticQuestions() { |
5 | 45 | return ( |
6 | | - <div> |
7 | | - <Texto /> |
8 | | - <Documento /> |
9 | | - <div>gerar por audio</div> |
| 46 | + <div className="max-w-5xl mx-auto"> |
| 47 | + <div className="mb-8"> |
| 48 | + <h2 className="text-2xl font-bold mb-2"> |
| 49 | + Geração Automática de Questões |
| 50 | + </h2> |
| 51 | + <p className="text-gray-600"> |
| 52 | + Escolha como você deseja gerar as questões automaticamente |
| 53 | + </p> |
| 54 | + </div> |
| 55 | + |
| 56 | + <div className="grid grid-cols-1 md:grid-cols-3 gap-6"> |
| 57 | + {/* Opção: Texto */} |
| 58 | + <button |
| 59 | + onClick={() => setMode("text")} |
| 60 | + className="group bg-layout-card border-2 border-gray-200 rounded-xl p-6 hover:border-blue-500 hover:shadow-lg transition-all duration-200 text-left" |
| 61 | + > |
| 62 | + <div className="w-14 h-14 bg-blue-100 rounded-lg flex items-center justify-center mb-4 group-hover:bg-blue-500 transition-colors"> |
| 63 | + <svg |
| 64 | + className="w-7 h-7 text-blue-600 group-hover:text-white transition-colors" |
| 65 | + fill="none" |
| 66 | + stroke="currentColor" |
| 67 | + viewBox="0 0 24 24" |
| 68 | + > |
| 69 | + <path |
| 70 | + strokeLinecap="round" |
| 71 | + strokeLinejoin="round" |
| 72 | + strokeWidth={2} |
| 73 | + d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" |
| 74 | + /> |
| 75 | + </svg> |
| 76 | + </div> |
| 77 | + <h3 className="text-xl font-semibold mb-2">Texto</h3> |
| 78 | + <p className="text-sm text-gray-600"> |
| 79 | + Cole ou digite um texto e gere questões automaticamente |
| 80 | + com IA |
| 81 | + </p> |
| 82 | + </button> |
| 83 | + |
| 84 | + {/* Opção: Documento */} |
| 85 | + <button |
| 86 | + onClick={() => setMode("document")} |
| 87 | + className="group bg-layout-card border-2 border-gray-200 rounded-xl p-6 hover:border-green-500 hover:shadow-lg transition-all duration-200 text-left" |
| 88 | + > |
| 89 | + <div className="w-14 h-14 bg-green-100 rounded-lg flex items-center justify-center mb-4 group-hover:bg-green-500 transition-colors"> |
| 90 | + <svg |
| 91 | + className="w-7 h-7 text-green-600 group-hover:text-white transition-colors" |
| 92 | + fill="none" |
| 93 | + stroke="currentColor" |
| 94 | + viewBox="0 0 24 24" |
| 95 | + > |
| 96 | + <path |
| 97 | + strokeLinecap="round" |
| 98 | + strokeLinejoin="round" |
| 99 | + strokeWidth={2} |
| 100 | + d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z" |
| 101 | + /> |
| 102 | + </svg> |
| 103 | + </div> |
| 104 | + <h3 className="text-xl font-semibold mb-2">Documento</h3> |
| 105 | + <p className="text-sm text-gray-600"> |
| 106 | + Faça upload de PDF, DOCX ou TXT para gerar questões |
| 107 | + </p> |
| 108 | + </button> |
| 109 | + |
| 110 | + {/* Opção: Áudio */} |
| 111 | + <button |
| 112 | + onClick={() => setMode("audio")} |
| 113 | + className="group bg-layout-card border-2 border-gray-200 rounded-xl p-6 hover:border-purple-500 hover:shadow-lg transition-all duration-200 text-left" |
| 114 | + > |
| 115 | + <div className="w-14 h-14 bg-purple-100 rounded-lg flex items-center justify-center mb-4 group-hover:bg-purple-500 transition-colors"> |
| 116 | + <svg |
| 117 | + className="w-7 h-7 text-purple-600 group-hover:text-white transition-colors" |
| 118 | + fill="none" |
| 119 | + stroke="currentColor" |
| 120 | + viewBox="0 0 24 24" |
| 121 | + > |
| 122 | + <path |
| 123 | + strokeLinecap="round" |
| 124 | + strokeLinejoin="round" |
| 125 | + strokeWidth={2} |
| 126 | + d="M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z" |
| 127 | + /> |
| 128 | + </svg> |
| 129 | + </div> |
| 130 | + <h3 className="text-xl font-semibold mb-2">Áudio</h3> |
| 131 | + <p className="text-sm text-gray-600"> |
| 132 | + Envie um arquivo de áudio para transcrever e gerar |
| 133 | + questões |
| 134 | + </p> |
| 135 | + </button> |
| 136 | + </div> |
| 137 | + |
| 138 | + <div className="mt-8 p-4 bg-blue-50 border border-blue-200 rounded-lg"> |
| 139 | + <div className="flex items-start gap-3"> |
| 140 | + <svg |
| 141 | + className="w-5 h-5 text-blue-600 mt-0.5 shrink-0" |
| 142 | + fill="currentColor" |
| 143 | + viewBox="0 0 20 20" |
| 144 | + > |
| 145 | + <path |
| 146 | + fillRule="evenodd" |
| 147 | + d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" |
| 148 | + clipRule="evenodd" |
| 149 | + /> |
| 150 | + </svg> |
| 151 | + <div> |
| 152 | + <p className="text-sm font-medium text-blue-900"> |
| 153 | + Dica |
| 154 | + </p> |
| 155 | + <p className="text-sm text-blue-800"> |
| 156 | + A geração automática usa inteligência artificial |
| 157 | + para criar questões relevantes baseadas no conteúdo |
| 158 | + fornecido. Você poderá revisar e editar as questões |
| 159 | + antes de finalizar. |
| 160 | + </p> |
| 161 | + </div> |
| 162 | + </div> |
| 163 | + </div> |
10 | 164 | </div> |
11 | 165 | ); |
12 | 166 | } |
0 commit comments