import { useState } from 'react'; import { Card, CardContent } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Textarea } from "@/components/ui/textarea"; import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"; import { BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer } from 'recharts'; import Image from "next/image"; import nhpaLogo from "/mnt/data/NHPA-Logo-Final.ai"; export default function PickleballStatsApp() { const [matchInfo, setMatchInfo] = useState({ date: '', tournament: '', player: '', matchType: 'singles', partner: '', opponents: ['', ''] }); const [score, setScore] = useState({ me: 0, opponent: 0 }); const [stats, setStats] = useState({ points: { active: 0, passive: 0 }, errors: { forced: 0, unforced: 0 }, actions: { serve: [0, 0], drive: [0, 0], deepDink: [0, 0], volley: [0, 0], shortDink: [0, 0], smash: [0, 0], lob: [0, 0], erne: [0, 0], atp: [0, 0], reset: [0, 0] } }); const [showSummary, setShowSummary] = useState(false); const addPoint = (type) => { const newScore = { ...score }; newScore.me++; setScore(newScore); setStats(prev => ({ ...prev, points: { ...prev.points, [type]: prev.points[type] + 1 } })); }; const addError = (type) => { const newScore = { ...score }; newScore.opponent++; setScore(newScore); setStats(prev => ({ ...prev, errors: { ...prev.errors, [type]: prev.errors[type] + 1 } })); }; const updateAction = (action, index) => { setStats(prev => { const updated = { ...prev.actions }; updated[action] = [...updated[action]]; updated[action][index]++; return { ...prev, actions: updated }; }); }; const renderActionButtons = () => ( Object.entries(stats.actions).map(([key, [success, fail]]) => (