PageSourceSearch

https://sg-limpach-rangliste.web.app/assets/Mitteilungen-DIHjL_KT.js

js sg-limpach-rangliste.web.app collected 2026-10-03 13:37:10 UTC 7,272 bytes, 4 lines download raw bytes

1import{r as m,j as e,s as u,A as b}from"./index-DEYl4_xm.js";import{T as p}from"./TextTeilenBox-D5kzV_9i.js";import"./shareCard-TPbErkwP.js";function w({mitteilungen:t,onUpsert:n,onDelete:r}){const[a,l]=m.useState(""),[d,x]=m.useState(""),[h,c]=m.useState(!1);async function f(){if(!(!a.trim()&&!d.trim())){c(!0);try{await n({titel:a.trim()||"Mitteilung",text:d.trim()}),l(""),x("")}finally{c(!1)}}}return e.jsxs("div",{style:{marginBottom:32,maxWidth:480},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2,marginBottom:10},children:[e.jsx("div",{style:u.sectionLabel,children:"Mitteilung an Mitglieder (in der App sichtbar)"}),e.jsx(b,{children:'Erscheint für alle eingeloggten Mitglieder auf der Seite "Meine Rechnungen & Mitteilungen" — anders als unten kein Text zum manuellen Weitergeben, sondern ein direkt in der App sichtbarer Eintrag.'})]}),e.jsxs("label",{style:{fontSize:12,display:"block"},children:["Titel",e.jsx("input",{value:a,onChange:i=>l(i.target.value),placeholder:"z.B. Schiessplatz am Samstag gesperrt",style:{display:"block",marginTop:4,width:"100%"}})]}),e.jsxs("label",{style:{fontSize:12,display:"block",marginTop:8},children:["Text",e.jsx("textarea",{value:d,onChange:i=>x(i.target.value),rows:3,style:{display:"block",marginTop:4,width:"100%",resize:"vertical"}})]}),e.jsx("button",{className:"btn red",onClick:f,disabled:h||!a.trim()&&!d.trim(),style:{marginTop:8},children:h?"Speichert …":"Veröffentlichen"}),t.length>0&&e.jsx("div",{style:{marginTop:16,display:"flex",flexDirection:"column",gap:8},children:t.map(i=>e.jsxs("div",{style:{background:"#fff",border:"1px solid var(--border)",borderRadius:8,padding:"10px 14px",display:"flex",justifyContent:"space-between",gap:10},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:700,fontSize:13},children:i.titel}),i.text&&e.jsx("div",{style:{fontSize:12.5,color:"var(--muted)",whiteSpace:"pre-wrap"},children:i.text})]}),e.jsx("button",{className:"btn ghost",style:{fontSize:11,padding:"3px 8px",alignSelf:"flex-start"},onClick:()=>{window.confirm(`"${i.titel}" wirklich löschen?`)&&r(i.id)},children:"Löschen"})]},i.id))})]})}const S=["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"];function z(t){if(!t)return null;if(t instanceof Date)return t;if(typeof t.toDate=="function")return t.toDate();const n=new Date(t);return Number.isNaN(n.getTime())?null:n}function y(t){return`${t.getDate()}. ${S[t.getMonth()]} ${t.getFullYear()}`}function B(t,n){const r=[`📢 ${t.titel}`];return t.text&&r.push("",t.text),r.push("",`— ${(n==null?void 0:n.name)||"Verein"}`),r.join(`
2`)}function k(t,n){const r=z(t.datum),a=t.zeitVon?`, ${t.zeitVon}${t.zeitBis?`–${t.zeitBis}`:""} Uhr`:"",l=[`📅 ${t.titel||t.kategorie}`,`Wann: ${r?y(r):"?"}${a}`];return t.standort&&l.push(`Wo: ${t.standort}`),l.push("",`— ${(n==null?void 0:n.name)||"Verein"}`),l.join(`
3`)}function D(t){if(!t)return null;const n=new Date(`${t}T00:00:00`);return Number.isNaN(n.getTime())?null:n}function M(t,n){const r=new Date(n.getFullYear(),t.getMonth(),t.getDate());return r<n&&r.setFullYear(n.getFullYear()+1),r}function $(t,n,r,a){return[`🎂 ${t} hat am ${y(n)} Geburtstag — wird ${r}!`,"","Herzliche Gratulation im Voraus!","",`— ${(a==null?void 0:a.name)||"Verein"}`].join(`
4`)}function V({club:t,news:n=[],jahresprogramm:r=[],roster:a=[],vereinsdatenByMemberId:l={},mitteilungen:d=[],onUpsertMitteilung:x,onDeleteMitteilung:h}){const c=m.useMemo(()=>{const i=new Date;return i.setHours(0,0,0,0),(r||[]).map(s=>({...s,_datum:z(s.datum)})).filter(s=>s._datum&&s._datum>=i).sort((s,o)=>s._datum-o._datum).slice(0,8)},[r]),f=m.useMemo(()=>{const i=new Date;i.setHours(0,0,0,0);const s=new Date(i);return s.setDate(s.getDate()+30),a.map(o=>{var v;const g=D((v=l[o.id])==null?void 0:v.geburtsdatum);if(!g)return null;const j=M(g,i);if(j>s)return null;const T=j.getFullYear()-g.getFullYear();return{member:o,naechster:j,alter:T}}).filter(Boolean).sort((o,g)=>o.naechster-g.naechster)},[a,l]);return e.jsxs("div",{style:{padding:"0 28px 40px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2,marginBottom:8},children:[e.jsx("div",{style:u.sectionLabel,children:"Schwarzes Brett / Mitteilungen"}),e.jsx(b,{children:'Fertige Textvorschläge zum Weitergeben — "Kopieren/Teilen" öffnet auf dem Handy direkt die native Teilen-Auswahl (z.B. WhatsApp-Gruppenchat), auf dem Desktop landet der Text in der Zwischenablage. Kein automatischer Versand — du entscheidest jedes Mal, wohin.'})]}),e.jsx("div",{style:{fontSize:12.5,color:"var(--muted)",marginBottom:24,maxWidth:640},children:'Zahlungserinnerungen an einzelne Mitglieder findest du bei "Rechnungsstellung" direkt in der Rechnungsliste.'}),e.jsx(w,{mitteilungen:d,onUpsert:x,onDelete:h}),e.jsxs("div",{style:{marginBottom:32,maxWidth:480},children:[e.jsx("div",{style:{...u.sectionLabel,marginBottom:10},children:"Freie Mitteilung (zum manuellen Weitergeben, z.B. WhatsApp)"}),e.jsx(p,{defaultText:"",rows:5})]}),e.jsxs("div",{style:{marginBottom:32},children:[e.jsx("div",{style:{...u.sectionLabel,marginBottom:10},children:"Anstehende Geburtstage (nächste 30 Tage)"}),f.length===0?e.jsx("div",{style:{color:"var(--muted)",fontSize:13},children:"Keine anstehenden Geburtstage mit hinterlegtem Geburtsdatum (Verwaltung > Mitglieder & Zugriff > Vereinsdaten)."}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:f.map(({member:i,naechster:s,alter:o})=>e.jsxs("div",{style:{background:"#fff",border:"1px solid var(--border)",borderRadius:8,padding:"12px 16px",maxWidth:480},children:[e.jsx("div",{style:{fontWeight:700,fontSize:13.5,marginBottom:2},children:i.name}),e.jsxs("div",{className:"mono",style:{fontSize:12,color:"var(--muted)",marginBottom:8},children:[y(s)," — wird ",o]}),e.jsx(p,{defaultText:$(i.name,s,o,t),rows:4})]},i.id))})]}),e.jsxs("div",{style:{marginBottom:32},children:[e.jsx("div",{style:{...u.sectionLabel,marginBottom:10},children:"Aus einer Neuigkeit"}),n.length===0?e.jsx("div",{style:{color:"var(--muted)",fontSize:13},children:"Noch keine Neuigkeiten erfasst (siehe Verwaltung > Vereinswebseite)."}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:n.slice(0,10).map(i=>e.jsxs("div",{style:{background:"#fff",border:"1px solid var(--border)",borderRadius:8,padding:"12px 16px",maxWidth:480},children:[e.jsx("div",{style:{fontWeight:700,fontSize:13.5,marginBottom:8},children:i.titel}),e.jsx(p,{defaultText:B(i,t),rows:4})]},i.id))})]}),e.jsxs("div",{children:[e.jsx("div",{style:{...u.sectionLabel,marginBottom:10},children:"Aus dem Jahresprogramm"}),c.length===0?e.jsx("div",{style:{color:"var(--muted)",fontSize:13},children:"Keine anstehenden Termine."}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:c.map(i=>e.jsxs("div",{style:{background:"#fff",border:"1px solid var(--border)",borderRadius:8,padding:"12px 16px",maxWidth:480},children:[e.jsx("div",{style:{fontWeight:700,fontSize:13.5,marginBottom:2},children:i.titel||i.kategorie}),e.jsx("div",{className:"mono",style:{fontSize:12,color:"var(--muted)",marginBottom:8},children:y(i._datum)}),e.jsx(p,{defaultText:k(i,t),rows:4})]},i.id))})]})]})}export{V 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.