{nav.find(x=>x[0]===page)?.[1]||'Cricket Arena'}
Premier League 2026 • Season 1
import React,{useEffect,useMemo,useState} from 'react';import{createRoot}from'react-dom/client';import{LayoutDashboard,Users,Shield,Radio,Trophy,Wallet,Search,Plus,Gavel,ChevronRight,Clock,LogOut,Menu,X,Settings,UserRound}from'lucide-react';import'./style.css'; const API='/api'; const demoTeams=[{id:1,name:'Royal Strikers',short_name:'RS',purse:50000,spent:31500,players:9},{id:2,name:'Thunder Kings',short_name:'TK',purse:50000,spent:27400,players:8},{id:3,name:'Blazing XI',short_name:'BX',purse:50000,spent:36200,players:10},{id:4,name:'Super Warriors',short_name:'SW',purse:50000,spent:22100,players:7}]; const demoPlayers=[{id:1,name:'Rajan Kumar',role:'All-Rounder',batting_style:'Right Hand',bowling_style:'Medium Pace',base_price:1000,status:'IN_AUCTION',photo:''},{id:2,name:'Arjun R',role:'Batsman',base_price:1500,status:'AVAILABLE'},{id:3,name:'Manoj K',role:'Bowler',base_price:1000,status:'SOLD',sold_price:5200,team_name:'Thunder Kings'},{id:4,name:'Kiran S',role:'Wicket Keeper',base_price:1200,status:'AVAILABLE'}]; async function request(path,opt={}){const token=localStorage.getItem('ca_token');const r=await fetch(API+path,{...opt,headers:{'Content-Type':'application/json',...(token?{Authorization:'Bearer '+token}:{}),...(opt.headers||{})}});if(!r.ok)throw new Error((await r.json().catch(()=>({}))).error||'Request failed');return r.json()} function App(){const[page,setPage]=useState(location.hash.slice(1)||'dashboard');const[menu,setMenu]=useState(false);const[teams,setTeams]=useState(demoTeams);const[players,setPlayers]=useState(demoPlayers);const[live,setLive]=useState({player:demoPlayers[0],current_bid:5400,leading_team:demoTeams[2],timer:10});const[online,setOnline]=useState(false); useEffect(()=>{const h=()=>setPage(location.hash.slice(1)||'dashboard');addEventListener('hashchange',h);return()=>removeEventListener('hashchange',h)},[]); useEffect(()=>{request('/index.php?action=bootstrap').then(d=>{setOnline(true);if(d.teams?.length)setTeams(d.teams);if(d.players?.length)setPlayers(d.players);if(d.live?.player)setLive(d.live)}).catch(()=>setOnline(false))},[]); const nav=[['dashboard','Dashboard',LayoutDashboard],['teams','Teams',Shield],['players','Players',Users],['auction','Auction Control',Gavel],['live','Live Display',Radio],['settings','Settings',Settings]]; const go=p=>{location.hash=p;setMenu(false)}; return
Premier League 2026 • Season 1
Manage franchises, player registrations, purse balances and the live auction from any device.
Franchise • Season 1
| Player | Role | Base Price | Status | Sold Price |
|---|---|---|---|---|
{p.name}{p.batting_style||'Cricketer'} | {p.role} | ₹{Number(p.base_price).toLocaleString('en-IN')} | {p.status.replace('_',' ')} | {p.sold_price?'₹'+Number(p.sold_price).toLocaleString('en-IN'):'—'} |
{live.player?.role} • {live.player?.batting_style} • {live.player?.bowling_style}
Leading: {live.leading_team?.name||'No bids yet'}
{live.player?.role} • {live.player?.batting_style}