PageSourceSearch

https://southernfm.com.au/assets/CalendarTab-CvILXpUQ.js

js southernfm.com.au collected 2026-09-24 21:13:50 UTC 4,281 bytes, 1 lines download raw bytes

1import{r as o,j as e,h as M,O as w,B as u,s as E}from"./index-CysU2Jg9.js";import{e as S,s as C,i as D}from"./subMonths-Bx2WLdxT.js";import{M as O}from"./map-pin-DCjLi05Y.js";import{C as k}from"./chevron-left-DZiAb83u.js";import{C as I}from"./chevron-right-C4GdRsTP.js";import{s as T,e as $,a as L,i as z}from"./startOfMonth-CefLwR_S.js";import{p as m}from"./parseISO-4vB8rYHK.js";import{f as a}from"./format-DEp8I5i1.js";import"./constructNow-CLP0GtTK.js";const G=()=>{const[i,f]=o.useState([]),[g,d]=o.useState(!0),[n,c]=o.useState(new Date);o.useEffect(()=>{(async()=>{d(!0);try{const{data:s,error:r}=await E.functions.invoke("calendar-feed");!r&&(s!=null&&s.events)&&f(s.events)}catch{}d(!1)})()},[]);const l=T(n),j=$(n),v=S({start:l,end:j}),x=l.getDay(),N=x===0?6:x-1,y=t=>i.filter(s=>{const r=m(s.start);return z(r,t)}),p=i.filter(t=>new Date(t.start)>=new Date).slice(0,15);return g?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(M,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 sm:p-6 lg:p-8",children:[e.jsx("h3",{className:"font-display text-lg sm:text-xl font-bold text-foreground mb-4",children:"Upcoming Events"}),p.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No upcoming events."}):e.jsx("div",{className:"space-y-3",children:p.map((t,s)=>{const r=m(t.start);return e.jsxs("div",{className:"flex gap-4 p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsxs("div",{className:"flex-shrink-0 w-14 text-center",children:[e.jsx("p",{className:"text-xs font-semibold text-primary uppercase",children:a(r,"MMM")}),e.jsx("p",{className:"text-2xl font-bold text-foreground leading-tight",children:a(r,"d")}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:a(r,"EEE")})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-semibold text-sm text-foreground",children:t.summary}),t.start&&e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1 mt-1",children:[e.jsx(w,{className:"h-3 w-3"}),a(r,"h:mm a"),t.end&&` – ${a(m(t.end),"h:mm a")}`]}),t.location&&e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1 mt-0.5",children:[e.jsx(O,{className:"h-3 w-3"}),t.location]}),t.description&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:t.description})]})]},t.uid||s)})})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 sm:p-6 lg:p-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx(u,{variant:"ghost",size:"icon",className:"h-10 w-10",onClick:()=>c(C(n,1)),children:e.jsx(k,{className:"h-5 w-5"})}),e.jsx("h3",{className:"font-display text-xl sm:text-2xl font-bold text-foreground",children:a(n,"MMMM yyyy")}),e.jsx(u,{variant:"ghost",size:"icon",className:"h-10 w-10",onClick:()=>c(L(n,1)),children:e.jsx(I,{className:"h-5 w-5"})})]}),e.jsx("div",{className:"grid grid-cols-7 gap-1.5 sm:gap-2 mb-2",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(t=>e.jsx("div",{className:"text-center text-xs sm:text-sm font-semibold text-muted-foreground py-2",children:t},t))}),e.jsxs("div",{className:"grid grid-cols-7 gap-1.5 sm:gap-2",children:[Array.from({length:N}).map((t,s)=>e.jsx("div",{className:"min-h-[3.5rem] sm:min-h-[6.5rem] lg:min-h-[7.5rem]"},`pad-${s}`)),v.map(t=>{const s=y(t),r=D(t);return e.jsxs("div",{className:`min-h-[3.5rem] sm:min-h-[6.5rem] lg:min-h-[7.5rem] rounded-xl border p-1.5 sm:p-2 overflow-hidden transition-colors ${r?"border-primary bg-primary/5":"border-border hover:border-primary/30 hover:bg-muted/30"}`,children:[e.jsx("p",{className:`text-sm font-medium mb-1 ${r?"text-primary font-bold":"text-foreground"}`,children:a(t,"d")}),e.jsxs("div",{className:"space-y-1",children:[s.slice(0,3).map((h,b)=>e.jsx("div",{className:"text-[11px] leading-tight px-1.5 py-1 rounded-md bg-primary/10 text-primary font-medium truncate",title:h.summary,children:h.summary},b)),s.length>3&&e.jsxs("p",{className:"text-[11px] text-muted-foreground px-1",children:["+",s.length-3," more"]})]})]},t.toISOString())})]})]})]})};export{G 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.