PageSourceSearch

https://tennisfriendsat.vercel.app/assets/index-EFqLt1kE.js

js tennisfriendsat.vercel.app collected 2026-10-03 07:52:09 UTC 6,777 bytes, 1 lines download raw bytes

1import{u as F,d as z,r as s,j as e,C as R,g as Y,c as w,a as C}from"./main-Cx62WSPe.js";import{A as H}from"./AdminHeader-D3PuqEvR.js";import{P as L,C as W}from"./ConfirmDialog-DnUzkd6k.js";import{g as G}from"./calendar-grid-Ce6VUHQH.js";import{g as O,a as V,b as _,W as q,f as y}from"./date-G1mTf7kT.js";import{S as B}from"./square-pen-C41DCjSd.js";import{T as I}from"./trash-2-CE_W1cnI.js";const K=w({method:"GET"}).handler(C("f24805d04494d8a020154189282330226358016dd49c9da99f003b235ce956f2")),Z=w({method:"POST"}).handler(C("e5e5213d6040ce0649cd392cfe6e8475e48043eca82e1160c2ad16d5b952ccf6"));function ne(){const m=F(),n=z(),b=new Date,[l,i]=s.useState(b.getMonth()+1),[d,u]=s.useState(b.getFullYear()),[g,f]=s.useState([]),[k,j]=s.useState(!0),[c,x]=s.useState(null),[h,v]=s.useState("grid"),p=s.useCallback(async()=>{j(!0);try{const t=await K({data:{month:l,year:d}});f(t)}catch{f([])}finally{j(!1)}},[l,d]);s.useEffect(()=>{p()},[p]);async function E(){c&&(await Z({data:{id:c.$id}}),x(null),p())}function M(){l===1?(i(12),u(t=>t-1)):i(t=>t-1)}function $(){l===12?(i(1),u(t=>t+1)):i(t=>t+1)}function S(){const t=new Date;i(t.getMonth()+1),u(t.getFullYear())}const A=G(d,l,g),D=O(l,d),N=[...g].filter(t=>{const a=new Date(t.startAt);return a.getMonth()+1===l&&a.getFullYear()===d}).sort((t,a)=>t.startAt.localeCompare(a.startAt));return e.jsxs("div",{children:[e.jsx(H,{title:n.admin.calendar.title,description:n.admin.calendar.description,actions:e.jsxs("button",{type:"button",onClick:()=>m({to:"/admin/calendar/new"}),className:"inline-flex items-center gap-2 px-4 py-2 bg-brand-primary-500 hover:bg-brand-primary-600 text-white text-sm font-semibold rounded-lg transition-colors cursor-pointer",children:[e.jsx(L,{size:16}),n.admin.calendar.newEvent]})}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h2",{className:"text-lg font-heading font-bold text-neutral-900 mb-4",children:["Veranstaltungen im ",D]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("div",{className:"inline-flex bg-white border border-neutral-200 rounded-lg overflow-hidden",children:[e.jsx("button",{type:"button",onClick:()=>v("grid"),className:`px-3 py-2 text-sm font-medium transition-colors cursor-pointer ${h==="grid"?"bg-neutral-100 text-neutral-900":"text-neutral-500 hover:text-neutral-700"}`,children:"Raster"}),e.jsx("button",{type:"button",onClick:()=>v("list"),className:`px-3 py-2 text-sm font-medium transition-colors cursor-pointer ${h==="list"?"bg-neutral-100 text-neutral-900":"text-neutral-500 hover:text-neutral-700"}`,children:"Liste"})]}),e.jsxs("div",{className:"inline-flex bg-white border border-neutral-200 rounded-lg overflow-hidden",children:[e.jsx("button",{type:"button",onClick:M,className:"px-3 py-2 text-sm font-medium text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50 transition-colors cursor-pointer",children:"‹ Zurück"}),e.jsx("button",{type:"button",onClick:S,className:"px-3 py-2 text-sm font-semibold text-neutral-700 hover:bg-neutral-50 transition-colors border-x border-neutral-200 cursor-pointer",children:"Heute"}),e.jsx("button",{type:"button",onClick:$,className:"px-3 py-2 text-sm font-medium text-neutral-600 hover:text-neutral-900 hover:bg-neutral-50 transition-colors cursor-pointer",children:"Weiter ›"})]})]})]}),k?e.jsx("div",{className:"text-center py-12 text-neutral-400",children:n.admin.common.loading}):h==="list"?e.jsx("div",{className:"bg-white rounded-xl border border-neutral-200 overflow-hidden",children:N.length===0?e.jsx("div",{className:"p-12 text-center text-neutral-400 text-sm",children:n.admin.calendar.noEventsMonth}):e.jsx("div",{className:"divide-y divide-neutral-100",children:N.map(t=>e.jsxs("div",{className:"flex items-center gap-4 px-5 py-4 hover:bg-neutral-50 transition-colors",children:[e.jsx("span",{className:"w-3 h-3 rounded-full shrink-0",style:{backgroundColor:t.location.color}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-semibold text-sm text-neutral-900 truncate",children:t.title}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-neutral-400 mt-0.5",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(R,{size:12}),V(t.startAt)," · ",_(t.startAt,t.endAt)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Y,{size:12}),t.location.name]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>m({to:"/admin/calendar/$id/edit",params:{id:t.$id}}),className:"p-1.5 text-neutral-400 hover:text-brand-primary-500 rounded-lg hover:bg-neutral-100 transition-colors cursor-pointer",title:"Edit",children:e.jsx(B,{size:16})}),e.jsx("button",{type:"button",onClick:()=>x(t),className:"p-1.5 text-neutral-400 hover:text-red-500 rounded-lg hover:bg-red-50 transition-colors cursor-pointer",title:"Delete",children:e.jsx(I,{size:16})})]})]},t.$id))})}):e.jsxs("div",{className:"bg-white rounded-xl border border-neutral-200 overflow-hidden",children:[e.jsx("div",{className:"grid grid-cols-7 border-b border-neutral-200 bg-neutral-50",children:q.map((t,a)=>e.jsx("div",{className:`px-2 py-2.5 text-center text-xs font-bold uppercase tracking-wider ${a>=5?"text-neutral-500":"text-neutral-400"}`,children:t},t))}),A.map((t,a)=>e.jsx("div",{className:"grid grid-cols-7 border-b border-neutral-100 last:border-b-0",children:t.map(r=>{const T=r.date.getDay()===0,P=r.date.getDay()===6;return e.jsxs("div",{className:`min-h-[110px] p-1.5 border-r border-neutral-100 last:border-r-0 ${r.isCurrentMonth?r.isToday?"bg-brand-primary-soft/30":T?"bg-green-50/40":P?"bg-blue-50/20":"bg-white":"bg-neutral-50/50"}`,children:[e.jsx("div",{className:"flex justify-end mb-0.5",children:e.jsx("span",{className:`text-sm font-bold w-7 h-7 flex items-center justify-center rounded-full ${r.isToday?"bg-brand-primary-500 text-white":r.isCurrentMonth?"text-neutral-600":"text-neutral-300"}`,children:r.dayNumber})}),e.jsx("div",{className:"flex flex-col gap-0.5",children:r.events.map(o=>e.jsxs("button",{type:"button",onClick:()=>m({to:"/admin/calendar/$id/edit",params:{id:o.$id}}),className:"w-full text-left text-[11px] leading-tight px-1.5 py-0.5 rounded truncate cursor-pointer transition-opacity hover:opacity-80",style:{backgroundColor:o.location.color,color:"#fff"},title:`${y(o.startAt)}: ${o.title}`,children:[e.jsx("span",{className:"font-semibold",children:y(o.startAt)}),": ",o.title]},o.$id))})]},r.date.toISOString())})},`week-${a}`))]})]}),e.jsx(W,{open:!!c,title:n.admin.calendar.deleteTitle,message:n.admin.calendar.deleteMessage.replace('""',`"${c?.title}"`),confirmLabel:n.admin.common.delete,destructive:!0,onConfirm:E,onCancel:()=>x(null)})]})}export{ne as component};

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.