PageSourceSearch

https://ajsports.ch/assets/CategoryPage-BfMjtV6z.js

js ajsports.ch collected 2026-10-07 20:35:11 UTC 10,343 bytes, 1 lines download raw bytes

1import{u as q,a as d,j as e,h as V}from"./index--K1IG5qV.js";import{f as J,h as Q,b as r,L as T}from"./react-vendor-DthM79EF.js";import{r as W,a as O,b as Z,c as ee,u as te,d as R,N as se,S as ae,F as re}from"./useSeo-CHXWK5MV.js";import{c as ie,C as B}from"./structuredData-Bjtehhto.js";import{E as ne}from"./EventCard-CkExRF0L.js";import oe from"./NotFound-CqrixqSk.js";import{S as le}from"./search-CWN0WO86.js";import{C as ce}from"./circle-x-DUCAy7On.js";import{C as de}from"./chevron-down-pc1i8fya.js";import"./Logo-BEhcjTGP.js";import"./x-BD7ChPFQ.js";import"./createLucideIcon-DS_ScZyR.js";import"./check-CuzriT7q.js";import"./trophy-B9OHAkoG.js";import"./clock-B-dwa0dG.js";import"./play-D8P8aYja.js";import"./arrow-left-BxapdtgO.js";const me=[{label:"Football",slug:"football"},{label:"NBA",slug:"nba"},{label:"NFL",slug:"nfl"},{label:"UFC",slug:"ufc"},{label:"Other Sports",slug:"other-sports"},{label:"Special Events",slug:"special"}],xe=60,De=()=>{const{categorySlug:l}=J(),{events:y,loading:I}=q(),[K,A]=Q(),x=(K.get("q")||"").trim(),[n,j]=r.useState(x),[E,z]=r.useState(!1),[p,N]=r.useState(16);r.useEffect(()=>{j(x),N(16)},[x]);const h=V(l||""),u=h!=="Category",m=l==="special",D=l==="other-sports",o=m?"Special Events":h,c=r.useMemo(()=>{if(!u)return[];const t=[d.DARTS,d.MOTORSPORTS,d.BOXING,d.CRICKET,d.HOCKEY,d.OTHER];return y.filter(s=>m?s.isSpecial:D?t.includes(s.category):s.category===h)},[y,h,m,D,u]),w=r.useMemo(()=>{const t=n.toLowerCase().trim();return t?c.filter(s=>s.teams.toLowerCase().includes(t)||s.league.toLowerCase().includes(t)||s.keywords&&s.keywords.toLowerCase().includes(t)):c},[c,n]),g=r.useMemo(()=>[...w].sort((t,s)=>new Date(t.startTime).getTime()-new Date(s.startTime).getTime()),[w]),L=r.useMemo(()=>g.slice(0,p),[g,p]),f=r.useMemo(()=>g.slice(p),[g,p]),M=r.useMemo(()=>{const t=[],s={},b=i=>{const a=new Date(i);return`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`},X=i=>{const a=new Date(i),k=new Date,P=new Date(k.getFullYear(),k.getMonth(),k.getDate()),S=new Date(P);S.setDate(S.getDate()+1);const $=new Date(a.getFullYear(),a.getMonth(),a.getDate()),C=a.toLocaleDateString("en-GB",{day:"numeric",month:"long"});return $.getTime()===P.getTime()?`Today, ${C}`:$.getTime()===S.getTime()?`Tomorrow, ${C}`:C};return L.forEach(i=>{const a=b(i.startTime);s[a]||(s[a]=[]),s[a].push(i)}),Object.keys(s).sort().forEach(i=>{t.push({dateKey:i,dateLabel:X(s[i][0].startTime),events:s[i]})}),t},[L]),H=r.useMemo(()=>[...c].sort((t,s)=>new Date(t.startTime).getTime()-new Date(s.startTime).getTime()).slice(0,xe).map(t=>({name:t.teams,path:O(t),image:W(t)})),[c]),v=m?Z():ee(o,c.length);if(te(u?{title:v.title,description:v.description,canonicalPath:R(l||""),jsonLd:ie({sportName:o,slug:l||"",description:v.description,items:H})}:{}),!u)return e.jsx(oe,{});const F=()=>{j(""),N(16),x&&A({},{replace:!0})},G=()=>{N(t=>t+12)},U=w.length,Y=I&&y.length===0,_=t=>{const s=new Date(t);return Number.isNaN(s.getTime())?"":s.toLocaleString("en-GB",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit",hour12:!1})};return e.jsxs("div",{className:"min-h-screen bg-black text-white flex flex-col",children:[e.jsx(se,{onSearch:()=>{}}),e.jsxs("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-8 md:pt-12 flex-1 w-full space-y-12 md:space-y-16",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsx("nav",{"aria-label":"Breadcrumb",children:e.jsxs("ol",{className:"flex items-center gap-2 text-[10px] font-black uppercase tracking-widest text-zinc-500",children:[e.jsx("li",{children:e.jsx(T,{to:"/",className:"hover:text-sky-400 transition-colors",children:ae})}),e.jsx("li",{"aria-hidden":"true",className:"text-zinc-700",children:e.jsx(B,{className:"w-3 h-3"})}),e.jsx("li",{"aria-current":"page",className:"text-zinc-300",children:o})]})}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-8",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:`text-[10px] font-black uppercase tracking-[0.3em] ${m?"text-yellow-500":"text-sky-500"}`,children:"Browsing Category"}),e.jsx("h1",{className:"text-4xl md:text-6xl font-black tracking-tighter capitalize leading-none",children:o}),e.jsxs("p",{className:"text-zinc-500 text-xs md:text-sm font-medium max-w-xl pt-2",children:["Every ",o.toLowerCase()," fixture we are tracking, with kick-off times shown in your local timezone and the viewing options listed for each match."]})]}),e.jsxs("div",{className:"flex flex-col items-start md:items-end gap-3 min-w-[240px]",children:[e.jsxs("div",{className:`relative w-full max-w-[200px] transition-all duration-300 ${E?"opacity-100":"opacity-50 hover:opacity-100"}`,children:[e.jsx(le,{className:`absolute left-0 top-1/2 -translate-y-1/2 w-3.5 h-3.5 transition-colors ${E?"text-sky-400":"text-zinc-400"}`}),e.jsx("input",{type:"text","aria-label":`Search ${o} events`,placeholder:"Search events...",value:n,onChange:t=>j(t.target.value),onFocus:()=>z(!0),onBlur:()=>z(!1),className:"w-full bg-transparent border-b border-white/20 py-1.5 pl-6 pr-6 text-[11px] font-bold transition-all outline-none focus:border-sky-500/50 placeholder:text-zinc-600"}),n&&e.jsx("button",{onClick:F,"aria-label":"Clear search",className:"absolute right-0 top-1/2 -translate-y-1/2 p-1 text-zinc-500 hover:text-white transition-colors",children:e.jsx(ce,{className:"w-3 h-3"})})]}),e.jsx("div",{className:"text-right",children:e.jsxs("p",{className:"text-zinc-500 text-[9px] md:text-[10px] font-black uppercase tracking-[0.2em]",children:[n?"Matches":"Active Events",": ",e.jsx("span",{className:"text-zinc-300",children:U})]})})]})]})]}),e.jsx("div",{className:"space-y-16 pb-8",children:Y?e.jsxs("div",{className:"text-center py-32 md:py-48 bg-zinc-900/10 rounded-[2rem] md:rounded-[3.5rem] border border-dashed border-white/5 flex flex-col items-center justify-center space-y-4",children:[e.jsxs("div",{className:"relative w-12 h-12",children:[e.jsx("div",{className:"absolute inset-0 border-4 border-sky-500/20 rounded-full"}),e.jsx("div",{className:"absolute inset-0 border-4 border-transparent border-t-sky-500 rounded-full animate-spin"})]}),e.jsx("p",{className:"text-zinc-500 text-sm md:text-base font-bold uppercase tracking-widest",children:"Loading fixtures..."})]}):M.length>0?e.jsxs(e.Fragment,{children:[M.map((t,s)=>e.jsxs("section",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-700",style:{animationDelay:`${s*100}ms`},children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("h2",{className:"text-lg md:text-xl font-black tracking-tighter uppercase text-white/90",children:e.jsx("time",{dateTime:t.dateKey,children:t.dateLabel})}),e.jsx("div",{className:"h-px flex-1 bg-gradient-to-r from-white/10 to-transparent"})]}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-10",children:t.events.map(b=>e.jsx(ne,{event:b},b.id))})]},t.dateKey)),f.length>0&&e.jsx("div",{className:"flex justify-center pt-8 animate-in fade-in slide-in-from-bottom-4 duration-700",children:e.jsxs("button",{onClick:G,className:"group relative px-8 py-4 bg-zinc-900/60 backdrop-blur-xl border border-white/10 rounded-2xl hover:bg-sky-500/10 hover:border-sky-500/30 transition-all duration-300 hover:scale-105 active:scale-95",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm md:text-base font-black uppercase tracking-widest text-zinc-300 group-hover:text-sky-400 transition-colors",children:"Load More"}),e.jsx(de,{className:"w-5 h-5 text-zinc-400 group-hover:text-sky-400 group-hover:translate-y-1 transition-all"})]}),e.jsxs("p",{className:"text-[9px] md:text-[10px] font-bold uppercase tracking-wider text-zinc-500 mt-1",children:[Math.min(12,f.length)," more events"]})]})})]}):e.jsxs("div",{className:"text-center py-24 md:py-32 bg-zinc-900/10 rounded-[2rem] md:rounded-[3.5rem] border border-dashed border-white/5 flex flex-col items-center justify-center space-y-4",children:[e.jsx("p",{className:"text-zinc-500 text-sm md:text-base font-bold uppercase tracking-widest",children:n?`No matches for "${n}"`:`No ${o.toLowerCase()} fixtures are scheduled right now.`}),n?e.jsx("button",{onClick:F,className:"text-sky-500 font-black text-[10px] uppercase tracking-[0.2em] hover:text-sky-400 transition-colors",children:"Clear Filters"}):e.jsx("p",{className:"text-zinc-600 text-[11px] font-medium max-w-md",children:"New fixtures are added as soon as the schedule is published. Try another sport below in the meantime."})]})}),f.length>0&&e.jsxs("section",{"aria-labelledby":"remaining-fixtures",className:"space-y-6 pb-8",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("h2",{id:"remaining-fixtures",className:"text-lg md:text-xl font-black tracking-tighter uppercase text-white/90",children:"Rest of the schedule"}),e.jsx("div",{className:"h-px flex-1 bg-gradient-to-r from-white/10 to-transparent"})]}),e.jsx("ul",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-1",children:f.map(t=>e.jsx("li",{children:e.jsxs(T,{to:O(t),className:"group flex items-baseline gap-3 py-2 border-b border-white/5 text-xs text-zinc-400 hover:text-white transition-colors",children:[e.jsx("time",{dateTime:t.
1startTime,className:"shrink-0 tabular-nums text-[10px] font-black uppercase tracking-wider text-zinc-600 group-hover:text-sky-500 transition-colors",children:_(t.startTime)}),e.jsx("span",{className:"truncate font-bold",children:t.teams}),e.jsx("span",{className:"truncate text-[10px] text-zinc-600 ml-auto",children:t.league})]})},t.id))})]}),e.jsxs("nav",{"aria-label":"Other sports",className:"space-y-4 pb-20",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.3em] text-zinc-600",children:"Browse other sports"}),e.jsx("ul",{className:"flex flex-wrap items-center gap-2 md:gap-3",children:me.filter(t=>t.slug!==l).map(t=>e.jsx("li",{children:e.jsxs(T,{to:R(t.slug),className:"inline-flex items-center gap-1.5 text-[10px] font-black uppercase tracking-[0.2em] text-zinc-400 hover:text-white py-2.5 px-5 rounded-full border border-white/10 hover:border-sky-500/40 hover:bg-sky-500/5 transition-all",children:[t.label,e.jsx(B,{className:"w-3 h-3"})]})},t.slug))})]})]}),e.jsx(re,{})]})};export{De as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.