"use client"; import { useMemo, useState } from "react"; import type { FanGoal, Team } from "../../types/passport"; import ProgressBar from "../shared/ProgressBar"; export interface OnboardingSelection { displayName: string; favoriteTeamId: string; selectedGoalIds: string[]; } interface OnboardingScreenProps { teams: Team[]; fanGoals: FanGoal[]; onComplete: (selection: OnboardingSelection) => void; } const steps = ["Identity", "Goals", "Starter pack"]; export default function OnboardingScreen({ teams, fanGoals, onComplete, }: OnboardingScreenProps) { const [step, setStep] = useState(0); const [displayName, setDisplayName] = useState("Passport Founder"); const [favoriteTeamId, setFavoriteTeamId] = useState(teams[0]?.id ?? ""); const [selectedGoalIds, setSelectedGoalIds] = useState([ "goal-england-matches", "goal-sticker-album", ]); const featuredTeams = useMemo(() => teams.slice(0, 8), [teams]); const favoriteTeam = teams.find((team) => team.id === favoriteTeamId) ?? teams[0]; const selectedGoals = fanGoals.filter((goal) => selectedGoalIds.includes(goal.id)); const canContinue = step === 0 ? displayName.trim().length >= 2 && Boolean(favoriteTeamId) : step === 1 ? selectedGoalIds.length > 0 : true; function toggleGoal(goalId: string) { setSelectedGoalIds((current) => { if (current.includes(goalId)) { return current.filter((id) => id !== goalId); } return [...current, goalId].slice(-3); }); } function handleNext() { if (!canContinue) { return; } if (step < steps.length - 1) { setStep((current) => current + 1); return; } onComplete({ displayName: displayName.trim() || "Passport Founder", favoriteTeamId, selectedGoalIds, }); } return (

FIFA World Cup 2026 prototype

Your football passport starts here.

Collect teams, stadiums, match stamps, predictions, trivia wins, stickers, achievements, leaderboard rank, and tournament memories in one daily fan journey.

{steps.map((label, index) => ( {index + 1} ))}
{step === 0 ? (

Choose your fan identity

Funders can experience the first-run flow: name the passport and pick a favourite team that powers personalised challenges.

setDisplayName(event.target.value)} value={displayName} />
{featuredTeams.map((team) => ( ))}
) : null} {step === 1 ? (

Pick up to three fan goals

Goals shape dashboard recommendations and show how the passport becomes a daily habit loop.

{fanGoals.map((goal) => ( ))}
) : null} {step === 2 ? (

Starter pack ready

Your first team page, starter sticker, and daily mission list are prepared. The next tap lands inside the live passport dashboard.

{selectedGoals.map((goal) => ( {goal.title} ))}
) : null}
{step > 0 ? ( ) : null}
); }