PageSourceSearch

https://faf.co.ao/assets/Matches-ByjhJOT8.js

js faf.co.ao collected 2026-10-02 19:10:36 UTC 8,596 bytes, 1 lines download raw bytes

1import{r as m,b as W,j as e,L as Y}from"./vendor-react-core-_0sZDOLQ.js";import{B as y,c as z,b as O}from"./index-j07E1qHv.js";import{C as P,a as R}from"./card-DHmBnTdH.js";import{S as A,a as C,b as S,c as M,d as F}from"./select-DHshRvNJ.js";import{m as D}from"./vendor-framer-motion-C1oRD-X5.js";import{h as g,a_ as q,al as B,i as E,l as _,Z as Q,aN as U}from"./vendor-lucide-Ddz0eB7N.js";import"./vendor-radix-CFmJ1img.js";import"./vendor-utils-BRu4i-LD.js";import"./vendor-supabase-Ca6cp8v2.js";function te(){const[n,k]=m.useState("all"),[o,x]=m.useState(new Date().getFullYear().toString()),[l,r]=m.useState(new Date().getMonth()),{data:p,isLoading:j}=W({queryKey:["matches"],queryFn:()=>O.entities.Match.list("-match_date",200),initialData:[]}),f=[{value:"all",label:"Todas as Competições"},{value:"Segunda Divisão",label:"Segunda Divisão",aliases:["Segunda Divisao"]},{value:"Taça de Angola",label:"Taça de Angola",aliases:["Taca de Angola"]},{value:"Supertaça de Angola",label:"Supertaça de Angola",aliases:["Supertaca de Angola","Supertaça","Supertaca"]},{value:"Campeonato do Mundo (FIFA World Cup)",label:"Campeonato do Mundo (FIFA World Cup)",aliases:["Campeonato do Mundo","FIFA World Cup","Mundial"]},{value:"Qualificação para o Campeonato do Mundo (FIFA World Cup)",label:"Qualificação para o Campeonato do Mundo (FIFA World Cup)",aliases:["Qualificação Mundial","Qualificacao Mundial","Qualificação Mundial 2026","Qualificação para o Mundial"]},{value:"Campeonato Africano das Nações (CAN)",label:"Campeonato Africano das Nações (CAN)",aliases:["CAN","AFCON","Campeonato Africano das Nacoes"]},{value:"Qualificação para o Campeonato Africano das Nações (CAN)",label:"Qualificação para o Campeonato Africano das Nações (CAN)",aliases:["Qualificação CAN","Qualificacao CAN","Qualificação para o CAN"]},{value:"Jogos Amigáveis (Datas FIFA)",label:"Jogos Amigáveis (Datas FIFA)",aliases:["Amigável","Amigavel","Amigáveis","Amigaveis","Datas FIFA"]}],I=Array.from({length:6},(a,s)=>(new Date().getFullYear()-s).toString()),T=["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],h=m.useMemo(()=>p.filter(a=>{const s=new Date(a.match_date),t=f.find(u=>u.value===n),c=[t==null?void 0:t.value,t==null?void 0:t.label,...(t==null?void 0:t.aliases)||[]],d=n==="all"||c.some(u=>a.competition===u),i=s.getFullYear().toString()===o,V=s.getMonth()===l;return d&&i&&V}),[p,n,o,l]),N=h.filter(a=>new Date(a.match_date)>new Date),b=h.filter(a=>new Date(a.match_date)<=new Date),v=a=>{a==="prev"?l===0?(r(11),x((parseInt(o)-1).toString())):r(l-1):l===11?(r(0),x((parseInt(o)+1).toString())):r(l+1)},J=a=>{const s={scheduled:"bg-blue-100 text-blue-800",live:"bg-green-100 text-green-800",finished:"bg-gray-100 text-gray-800"};return s[a]||s.scheduled},L=a=>({scheduled:"Agendado",live:"Ao Vivo",finished:"Terminado"})[a]||a,w=({match:a})=>{const s=new Date(a.match_date),t=s<=new Date,c=({logo:d,name:i})=>d?e.jsx("img",{src:d,className:"w-14 h-14 rounded-full object-contain bg-white border border-gray-100",alt:i,loading:"lazy",decoding:"async"}):e.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-full bg-red-600 text-sm font-black text-white",children:(i==null?void 0:i.slice(0,3).toUpperCase())||"FAF"});return e.jsx(Y,{to:z("MatchDetail")+`?id=${a.id}`,children:e.jsxs(D.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},whileHover:{scale:1.02},className:"bg-white rounded-xl shadow-md hover:shadow-xl transition-all p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{className:"w-4 h-4 text-red-600"}),e.jsx("span",{className:"text-sm font-bold text-gray-900",children:a.competition})]}),e.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-bold ${J(a.status)}`,children:L(a.status)})]}),e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx(c,{logo:a.home_logo,name:a.home_team}),e.jsx("span",{className:"font-bold text-lg",children:a.home_team})]}),e.jsx("div",{className:"text-center px-6",children:t?e.jsxs("div",{className:"text-3xl font-black text-gray-900",children:[a.home_score??0," - ",a.away_score??0]}):e.jsx("div",{className:"text-sm font-bold text-gray-500",children:"VS"})}),e.jsxs("div",{className:"flex items-center gap-3 flex-1 justify-end",children:[e.jsx("span",{className:"font-bold text-lg",children:a.away_team}),e.jsx(c,{logo:a.away_logo,name:a.away_team})]})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600 pt-4 border-t",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4"}),e.jsx("span",{children:s.toLocaleDateString("pt-AO",{day:"numeric",month:"short",year:"numeric"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{className:"w-4 h-4"}),e.jsx("span",{children:s.toLocaleTimeString("pt-AO",{hour:"2-digit",minute:"2-digit"})})]}),a.venue&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),e.jsx("span",{className:"truncate max-w-[120px]",children:a.venue})]})]})]})})};return e.jsxs("main",{className:"min-h-screen bg-gray-50",children:[e.jsx("section",{className:"bg-gradient-to-br from-faf-blue via-faf-blue-light to-faf-blue-dark py-16",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs(D.div,{initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},children:[e.jsx(g,{className:"w-12 h-12 mb-4 text-white"}),e.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4 text-white",children:"Calendário de Jogos"}),e.jsx("p",{className:"text-xl text-white/90",children:"Acompanhe todas as competições da FAF e os jogos das Seleções Nacionais"})]})})}),e.jsx("section",{className:"py-8 bg-white border-b",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(q,{className:"w-5 h-5 text-gray-600"}),e.jsx("span",{className:"font-bold text-gray-900",children:"Filtros:"})]}),e.jsxs("div",{className:"flex flex-wrap gap-4 items-center",children:[e.jsxs(A,{value:n,onValueChange:k,children:[e.jsx(C,{className:"w-[min(100vw-2rem,380px)]",children:e.jsx(S,{placeholder:"Competição"})}),e.jsx(M,{children:f.map(a=>e.jsx(F,{value:a.value,children:a.label},a.value))})]}),e.jsxs(A,{value:o,onValueChange:x,children:[e.jsx(C,{className:"w-[120px]",children:e.jsx(S,{placeholder:"Ano"})}),e.jsx(M,{children:I.map(a=>e.jsx(F,{value:a,children:a},a))})]}),e.jsxs("div",{className:"flex items-center gap-2 bg-gray-100 rounded-lg px-3 py-2",children:[e.jsx(y,{variant:"ghost",size:"icon",onClick:()=>v("prev"),className:"h-8 w-8",children:e.jsx(B,{className:"w-4 h-4"})}),e.jsx("span",{className:"font-bold text-sm min-w-[100px] text-center",children:T[l]}),e.jsx(y,{variant:"ghost",size:"icon",onClick:()=>v("next"),className:"h-8 w-8",children:e.jsx(E,{className:"w-4 h-4"})})]})]})]})})}),e.jsx("section",{className:"py-12",children:e.jsxs("div",{className:"container mx-auto px-4",children:[N.length>0&&e.jsxs("div",{className:"mb-12",children:[e.jsxs("h2",{className:"text-2xl font-black text-gray-900 mb-6 uppercase flex items-center gap-3",children:[e.jsx(_,{className:"w-6 h-6 text-blue-600"}),"Próximos Jogos"]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:N.map(a=>e.jsx(w,{match:a},a.id))})]}),b.length>0&&e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-black text-gray-900 mb-6 uppercase flex items-center gap-3",children:[e.jsx(g,{className:"w-6 h-6 text-red-600"}),"Resultados"]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:b.map(a=>e.jsx(w,{match:a},a.id))})]}),h.length===0&&!j&&e.jsx(P,{className:"text-center py-12",children:e.jsxs(R,{children:[e.jsx(Q,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),e.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-2",children:"Nenhum jogo encontrado"}),e.jsx("p",{className:"text-gray-600",children:"Não há jogos para os filtros selecionados"})]})}),j&&e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Array(6).fill(0).map((a,s)=>e.jsx("div",{className:"animate-pulse",children:e.jsx("div",{className:"bg-white rounded-xl p-6 h-48"})},s))})]})})]})}export{te 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.