From d76e7516751b83b69497d7075580316fb8abb06b Mon Sep 17 00:00:00 2001 From: JsCodeDevlopment Date: Tue, 12 May 2026 15:35:04 -0300 Subject: [PATCH 1/3] feat: define content schemas and add challenge view and results step components --- .../tests/_components/challenge-view.tsx | 126 +++++++++++++----- components/tests/_components/results-step.tsx | 52 ++++++++ lib/content/schemas.ts | 8 ++ 3 files changed, 155 insertions(+), 31 deletions(-) diff --git a/components/tests/_components/challenge-view.tsx b/components/tests/_components/challenge-view.tsx index 3b65c1d..f79afd4 100644 --- a/components/tests/_components/challenge-view.tsx +++ b/components/tests/_components/challenge-view.tsx @@ -1,8 +1,16 @@ import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog"; import { TechnicalTest } from "@/lib/content/schemas"; import { cn } from "@/lib/utils"; import Editor from "@monaco-editor/react"; -import { CheckCircle2, Play, XCircle } from "lucide-react"; +import { BookOpen, CheckCircle2, Lightbulb, Play, XCircle } from "lucide-react"; interface Props { test: TechnicalTest; @@ -69,42 +77,98 @@ export function ChallengeView({
-
-
+
+
-
- - Linguagem: - - + +
+
+ + Linguagem: + + +
+ + {test.solutions && test.solutions.length > 0 && ( + + + + + + + + Resoluções Sugeridas + + + Estuda a abordagem técnica recomendada para este desafio. + + + +
+ {test.solutions.map((sol) => ( +
+
+

+ {sol.title} +

+

+ {sol.explanation} +

+
+ +
+ {Object.entries(sol.code).map(([lang, code]) => ( +
+
+
+ + {lang} + +
+
+                                  {code}
+                                
+
+ ))} +
+
+ ))} +
+ +
+ )}
+
+ + {test.solutions && test.solutions.length > 0 && ( +
+ +
+ )} + {session?.user && (

✓ Resultados sincronizados com o teu perfil profissional @@ -102,6 +115,45 @@ export function ResultsStep({ })}

+ {/* RESOLUTIONS SECTION */} + {test.solutions && test.solutions.length > 0 && ( +
+

+ Resoluções Sugeridas (Prática) +

+
+ {test.solutions.map((sol) => ( +
+
+

+ {sol.title} +

+

+ {sol.explanation} +

+
+ +
+ {Object.entries(sol.code).map(([lang, code]) => ( +
+
+
+ + {lang} + +
+
+                        {code}
+                      
+
+ ))} +
+
+ ))} +
+
+ )} +
+ )} +
+ + {/* Feedback */} + {feedback && ( +
+ {feedback.msg} +
+ )} + + {/* Form Editor (Inline) */} + {isEditing && ( +
+

+ {isEditing === 'new' ? 'Criar Nova Categoria' : 'Editar Categoria'} +

+
+
+ + { + const val = e.target.value; + setFormData({ ...formData, name: val, slug: generateSlug(val) }); + }} + placeholder="Ex: Sistemas Distribuídos" + className="h-10 w-full rounded-lg border border-border bg-background px-3 text-sm focus:border-primary outline-none" + /> +
+
+ + setFormData({ ...formData, slug: e.target.value })} + className="h-10 w-full rounded-lg border border-border bg-background px-3 text-sm font-mono focus:border-primary outline-none" + /> +
+
+
+ +