"use client"; import { useState } from "react"; import { useUser } from "@/lib/context"; import { Users, Footprints, Check, Zap, Landmark } from "lucide-react"; import { motion } from "framer-motion"; interface TeamChallenge { id: string; title: string; description: string; reward: number; current: number; goal: number; joined: boolean; icon: React.ReactNode; } export default function SquadChallenges() { const { addLyts } = useUser(); const [challenges, setChallenges] = useState([ { id: "ch-steps", title: "Weekend Step Sprint", description: "Collectively log 50,000 steps with your team this weekend.", reward: 100, current: 41200, goal: 50000, joined: false, icon: , }, { id: "ch-stores", title: "Starbucks Double Drop", description: "Check in at any two Starbucks locations within 7 days.", reward: 40, current: 1, goal: 2, joined: true, icon: , }, ]); const handleJoinChallenge = (id: string, reward: number) => { setChallenges((prev) => prev.map((ch) => { if (ch.id === id) { if (ch.joined) { addLyts(reward); return { ...ch, current: ch.goal }; } return { ...ch, joined: true }; } return ch; }) ); }; return (
Section 13 • Squad Goals

Cooperative Team
Active Challenges

Connect with friends or match with nearby community squads. Log steps, complete visits, and unlock bulk LYT currency bonuses together.

{/* Challenges listing */}
{challenges.map((ch) => { const percentage = Math.min(100, Math.round((ch.current / ch.goal) * 100)); const isCompleted = ch.current >= ch.goal; return (
{ch.icon}

{ch.title}

{ch.description}

Reward +{ch.reward} LYTs
{ch.current.toLocaleString()} / {ch.goal.toLocaleString()} {percentage}%
); })}
); }