(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52683,e=>{"use strict";var s=e.i(43476),t=e.i(71645);e.i(23842);var a=e.i(45832),r=e.i(94884),l=e.i(71604),i=e.i(13607),n=e.i(66796),c=e.i(99011);function d(){let[e,d]=(0,t.useState)([]),[o,x]=(0,t.useState)(!1),[h,m]=(0,t.useState)("");async function g(){try{let e=await fetch("https://localhost:7275/api/teams"),s=await e.json();s.length>0?d(s):(x(!0),m("Network connection error - data is missing for all Teams. Please confirm API is running and port 7275 is unblocked, then try again."))}catch(e){console.error("Error fetching teams: ",e),x(!0),m(e)}}return(0,t.useEffect)(()=>{g()},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.NavBar,{}),(0,s.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 p-8",style:{overflow:"auto",marginTop:50},children:[o?(0,s.jsx)("div",{className:"flex content-center",children:(0,s.jsx)(i.Card,{sx:{maxWidth:345},children:(0,s.jsx)(c.default,{className:"bg-red-100",children:(0,s.jsxs)(n.Typography,{children:[(0,s.jsx)("b",{children:"ERROR:"})," ",h]})})})}):(0,s.jsx)(s.Fragment,{}),(0,s.jsx)("div",{className:"max-w-6xl mx-auto",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6 mb-6",children:[(0,s.jsx)("h1",{className:"text-4xl",children:"All Teams:"}),(0,s.jsx)(l.default,{children:(0,s.jsxs)("table",{className:"w-full",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b-2 border-gray-200",children:[(0,s.jsx)("th",{className:"text-left py-3 px-4 font-semibold text-gray-700",children:"Name:"}),(0,s.jsx)("th",{className:"text-left py-3 px-4 font-semibold text-gray-700",children:"City:"}),(0,s.jsx)("th",{className:"text-left py-3 px-4 font-semibold text-gray-700",children:"League:"})]})}),(0,s.jsx)("tbody",{children:e.map((e,t)=>(0,s.jsxs)("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"py-3 px-4",children:(0,s.jsxs)("a",{href:`./teams/${e.teamid}`,className:"text-[#0000ee]",children:[e.name," ",(0,s.jsxs)("b",{children:["[",e.abbr,"]"]})]})}),(0,s.jsx)("td",{className:"py-3 px-4 font-medium",children:e.city?e.city:"-"}),(0,s.jsxs)("td",{className:"py-3 px-4 text-gray-600",children:[1==e.leagueid?"American":"National"," League"]})]},t))})]})})]})})]}),(0,s.jsx)(r.Footer,{})]})}e.s(["default",()=>d])}]);