11"use client" ;
22
3- import { useState } from "react" ;
43import { Texto } from "./texto" ;
54import { Documento } from "./documento" ;
65import { Audio } from "./audio" ;
@@ -16,12 +15,13 @@ export interface AutomaticModeData {
1615}
1716
1817interface AutomaticQuestionsProps {
18+ mode : GenerationMode ;
19+ onModeSelect : ( mode : GenerationMode ) => void ;
1920 onDataChange : ( data : AutomaticModeData | null ) => void ;
2021 onSubmit ?: ( ) => void ;
2122}
2223
23- export default function AutomaticQuestions ( { onDataChange, onSubmit } : AutomaticQuestionsProps ) {
24- const [ mode , setMode ] = useState < GenerationMode > ( null ) ;
24+ export default function AutomaticQuestions ( { mode, onModeSelect, onDataChange, onSubmit } : AutomaticQuestionsProps ) {
2525
2626 const handleDataChange = ( data : { text ?: string ; file ?: File ; num_questions : number ; num_alternatives : number } | null ) => {
2727 if ( data && mode ) {
@@ -67,16 +67,16 @@ export default function AutomaticQuestions({ onDataChange, onSubmit }: Automatic
6767 < h2 className = "text-2xl font-bold mb-2" >
6868 Geração Automática de Questões
6969 </ h2 >
70- < p className = "text-gray-600" >
70+ < p >
7171 Escolha como você deseja gerar as questões automaticamente
7272 </ p >
7373 </ div >
7474
7575 < div className = "grid grid-cols-1 md:grid-cols-3 gap-6" >
7676 { /* Opção: Texto */ }
7777 < button
78- onClick = { ( ) => setMode ( "text" ) }
79- 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"
78+ onClick = { ( ) => onModeSelect ( "text" ) }
79+ className = "group bg-layout-card border-2 rounded-xl p-6 hover:border-blue-500 hover:shadow-lg transition-all duration-200 text-left"
8080 >
8181 < 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" >
8282 < svg
@@ -94,16 +94,16 @@ export default function AutomaticQuestions({ onDataChange, onSubmit }: Automatic
9494 </ svg >
9595 </ div >
9696 < h3 className = "text-xl font-semibold mb-2" > Texto</ h3 >
97- < p className = "text-sm text-gray-600 " >
97+ < p className = "text-sm " >
9898 Cole ou digite um texto e gere questões automaticamente
9999 com IA
100100 </ p >
101101 </ button >
102102
103103 { /* Opção: Documento */ }
104104 < button
105- onClick = { ( ) => setMode ( "document" ) }
106- 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"
105+ onClick = { ( ) => onModeSelect ( "document" ) }
106+ className = "group bg-layout-card border-2 rounded-xl p-6 hover:border-green-500 hover:shadow-lg transition-all duration-200 text-left"
107107 >
108108 < 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" >
109109 < svg
@@ -121,15 +121,15 @@ export default function AutomaticQuestions({ onDataChange, onSubmit }: Automatic
121121 </ svg >
122122 </ div >
123123 < h3 className = "text-xl font-semibold mb-2" > Documento</ h3 >
124- < p className = "text-sm text-gray-600 " >
124+ < p className = "text-sm " >
125125 Faça upload de PDF, DOCX ou TXT para gerar questões
126126 </ p >
127127 </ button >
128128
129129 { /* Opção: Áudio */ }
130130 < button
131- onClick = { ( ) => setMode ( "audio" ) }
132- 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"
131+ onClick = { ( ) => onModeSelect ( "audio" ) }
132+ className = "group bg-layout-card border-2 rounded-xl p-6 hover:border-purple-500 hover:shadow-lg transition-all duration-200 text-left"
133133 >
134134 < 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" >
135135 < svg
@@ -147,39 +147,12 @@ export default function AutomaticQuestions({ onDataChange, onSubmit }: Automatic
147147 </ svg >
148148 </ div >
149149 < h3 className = "text-xl font-semibold mb-2" > Áudio</ h3 >
150- < p className = "text-sm text-gray-600 " >
150+ < p className = "text-sm " >
151151 Envie um arquivo de áudio para transcrever e gerar
152152 questões
153153 </ p >
154154 </ button >
155155 </ div >
156-
157- < div className = "mt-8 p-4 bg-blue-50 border border-blue-200 rounded-lg" >
158- < div className = "flex items-start gap-3" >
159- < svg
160- className = "w-5 h-5 text-blue-600 mt-0.5 shrink-0"
161- fill = "currentColor"
162- viewBox = "0 0 20 20"
163- >
164- < path
165- fillRule = "evenodd"
166- 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"
167- clipRule = "evenodd"
168- />
169- </ svg >
170- < div >
171- < p className = "text-sm font-medium text-blue-900" >
172- Dica
173- </ p >
174- < p className = "text-sm text-blue-800" >
175- A geração automática usa inteligência artificial
176- para criar questões relevantes baseadas no conteúdo
177- fornecido. Você poderá revisar e editar as questões
178- antes de finalizar.
179- </ p >
180- </ div >
181- </ div >
182- </ div >
183156 </ div >
184157 ) ;
185158}
0 commit comments