"use client"; import { type FormEvent, useState } from "react"; import type { Match, Memory, MemoryType, NewMemoryInput, Team } from "../../types/passport"; import { formatMatchDate, getTeamById } from "../../utils/passportMetrics"; import StatusPill from "../shared/StatusPill"; interface MemoryTimelineScreenProps { memories: Memory[]; matches: Match[]; teams: Team[]; onAddMemory: (memory: NewMemoryInput) => void; } const memoryTypes: { value: MemoryType; label: string; icon: string }[] = [ { value: "match", label: "Match", icon: "โšฝ" }, { value: "stadium", label: "Stadium", icon: "๐ŸŸ๏ธ" }, { value: "prediction", label: "Prediction", icon: "๐Ÿ”ฎ" }, { value: "sticker", label: "Sticker", icon: "๐Ÿƒ" }, { value: "trivia", label: "Trivia", icon: "๐Ÿง " }, { value: "social", label: "Social", icon: "๐ŸŽ™๏ธ" }, ]; export default function MemoryTimelineScreen({ memories, matches, teams, onAddMemory, }: MemoryTimelineScreenProps) { const [type, setType] = useState("match"); const [title, setTitle] = useState(""); const [description, setDescription] = useState(""); const [mood, setMood] = useState("Buzzing"); const [matchId, setMatchId] = useState(""); const [teamIds, setTeamIds] = useState([]); const selectedType = memoryTypes.find((item) => item.value === type) ?? memoryTypes[0]; function toggleTeam(teamId: string) { setTeamIds((current) => { if (current.includes(teamId)) { return current.filter((id) => id !== teamId); } return [...current, teamId].slice(-3); }); } function handleSubmit(event: FormEvent) { event.preventDefault(); if (title.trim().length === 0 || description.trim().length === 0) { return; } onAddMemory({ type, title: title.trim(), description: description.trim(), icon: selectedType.icon, teamIds, matchId: matchId || undefined, mood: mood.trim() || "Memorable", }); setTitle(""); setDescription(""); setMood("Buzzing"); setMatchId(""); setTeamIds([]); } return (

Memory timeline

Save the tournament story.

Memories make the passport personal. Fans can attach moments to matches, teams, moods, sticker pulls, predictions, watch parties, and eventually real rewards.

Add a memory

Capture a passport moment

setMood(event.target.value)} value={mood} />
setTitle(event.target.value)} placeholder="e.g. Last-minute winner in the pub" value={title} />