This commit is contained in:
Björn Benouarets
2025-11-04 22:56:15 +01:00
parent cf9cc03c26
commit 9cf8b22120

View File

@@ -12,9 +12,16 @@ import {
} from "@/components/ui/radio-group"; } from "@/components/ui/radio-group";
export default function Home() { export default function Home() {
const options = process.env.NEXT_PUBLIC_MINIQUIZ_OPTIONS?.split(',') || []; const options = [
const correctAnswer = process.env.NEXT_PUBLIC_MINIQUIZ_ANSWER; "Berlin",
const nextLink = process.env.NEXT_PUBLIC_MINIQUIZ_NEXTURL || "/"; "Hamburg",
"München",
"Frankfurt",
"Köln",
"Hannover",
]
const correctAnswer = "Hannover";
const nextLink = "https://two.christian.miniquiz.your-apps.dev";
const [selectedAnswer, setSelectedAnswer] = React.useState<string | null>(null); const [selectedAnswer, setSelectedAnswer] = React.useState<string | null>(null);
const [showNextLink, setShowNextLink] = React.useState<boolean>(false); const [showNextLink, setShowNextLink] = React.useState<boolean>(false);
@@ -45,8 +52,8 @@ export default function Home() {
return ( return (
<div className="flex flex-col items-center justify-center h-screen p-10 gap-4"> <div className="flex flex-col items-center justify-center h-screen p-10 gap-4">
<div className="flex flex-col items-center justify-center max-w-2xl w-full gap-8"> <div className="flex flex-col items-center justify-center max-w-2xl w-full gap-8">
<h1 className="text-4xl font-bold">{process.env.NEXT_PUBLIC_MINIQUIZ_TITLE}</h1> <h1 className="text-4xl font-bold">18. Geburtstag</h1>
<p className="text-lg text-gray-500">{process.env.NEXT_PUBLIC_MINIQUIZ_QUESTION}</p> <p className="text-lg text-zinc-500">Wo findet eine Industriemesse statt mit internationaler Bedeutung, wo bereits der Bundeskanzler zu Besuch war und zufällig das zweitgrößte Messegelände der Welt ist?</p>
<RadioGroup onValueChange={handleAnswerChange} value={selectedAnswer} className="flex flex-col items-start justify-start w-full"> <RadioGroup onValueChange={handleAnswerChange} value={selectedAnswer} className="flex flex-col items-start justify-start w-full">
{options.map((option) => ( {options.map((option) => (
<div key={option} className="text-2xl font-bold flex items-center justify-start border border-zinc-300 gap-2 rounded-md p-4 w-full"> <div key={option} className="text-2xl font-bold flex items-center justify-start border border-zinc-300 gap-2 rounded-md p-4 w-full">