1import{v as m,r as n,j as t,L as u,p}from"./index-DeRTHkIH.js";import{b as g}from"./admin.functions-BGjOMUD9.js";const c={neu:{label:"Neu",cls:"bg-amber-100 text-amber-800"},in_bearbeitung:{label:"In Bearbeitung",cls:"bg-sky-100 text-sky-800"},alternative_angeboten:{label:"Alternative angeboten",cls:"bg-violet-100 text-violet-800"},bestaetigt_warten_kunde:{label:"Bestätigt â wartet auf Kunde",cls:"bg-emerald-100 text-emerald-800"},beantwortet:{label:"Beantwortet",cls:"bg-emerald-100 text-emerald-800"},gebucht:{label:"Gebucht",cls:"bg-teal-100 text-teal-800"},abgelehnt:{label:"Abgelehnt",cls:"bg-zinc-200 text-zinc-700"},storniert:{label:"Storniert",cls:"bg-zinc-200 text-zinc-700"}};function v(){const l=m(g),[r,x]=n.useState([]),[s,i]=n.useState("");n.useEffect(()=>{l().then(e=>x(e??[]))},[l]);const o=s?r.filter(e=>e.status===s):r;return t.jsxs("div",{children:[t.jsx("h1",{className:"font-display text-3xl font-semibold text-primary mb-6",children:"Anfragen"}),t.jsxs("div",{className:"flex gap-2 mb-4 flex-wrap",children:[t.jsxs("button",{onClick:()=>i(""),className:`text-xs px-3 py-1.5 rounded border ${s===""?"bg-primary text-primary-foreground border-primary":"border-border"}`,children:["Alle (",r.length,")"]}),Object.entries(c).map(([e,a])=>{const d=r.filter(b=>b.status===e).length;return d===0?null:t.jsxs("button",{onClick:()=>i(e),className:`text-xs px-3 py-1.5 rounded border ${s===e?"bg-primary text-primary-foreground border-primary":"border-border"}`,children:[a.label," (",d,")"]},e)})]}),t.jsx("div",{className:"bg-white rounded-2xl border border-border overflow-hidden",children:o.length===0?t.jsx("div",{className:"p-8 text-center text-foreground/60",children:"Keine Anfragen."}):t.jsx("div",{className:"divide-y divide-border",children:o.map(e=>{const a=c[e.status]??{label:e.status,cls:"bg-zinc-200"};return t.jsxs(u,{to:"/admin/inquiries/$id",params:{id:e.id},className:"px-6 py-4 hover:bg-zinc-50 flex items-center gap-4",children:[t.jsx("span",{className:`text-xs px-2 py-0.5 rounded whitespace-nowrap ${a.cls}`,children:a.label}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"font-medium text-sm truncate",children:[e.name," ",t.jsxs("span",{className:"text-foreground/50",children:["· ",e.email]})]}),t.jsxs("div",{className:"text-xs text-foreground/60 truncate",children:[e.property_titel?`${e.property_titel} · `:"",e.anreise," â ",e.abreise," · ",e.personen," Pers."]})]}),t.jsx("div",{className:"text-xs text-foreground/50 whitespace-nowrap",children:new Date(e.created_at).toLocaleDateString("de-DE")}),t.jsx(p,{className:"size-4 text-foreground/40"})]},e.id)})})})]})}export{v 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.