PageSourceSearch

https://firebrick-zebra-188625.hostingersite.com/assets/AdminContactMessagesPage-DRANWcmq.js

js firebrick-zebra-188625.hostingersite.com collected 2026-10-03 04:24:24 UTC 5,037 bytes, 1 lines download raw bytes

1import{c as w,r as t,j as s,i as k,d as S,a0 as C}from"./index-GcR74Bk4.js";import{E as M}from"./EmptyState-B9EllFCh.js";import{v as A,w as E,x as _}from"./adminService-By_OgUAH.js";import{M as T}from"./mail-D1mQjObB.js";import{S as L}from"./save-NWV3KwVd.js";import{C as Y}from"./circle-check-CgD0pxMx.js";import{T as I}from"./trash-2-KxD5bPpN.js";const K=w("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]),b={new:"Yeni",reviewing:"İnceleniyor",answered:"Yanıtlandı",archived:"Arşivlendi"};function F(){const[o,y]=t.useState([]),[u,x]=t.useState({}),[m,g]=t.useState(""),[h,f]=t.useState(""),[v,p]=t.useState(!0),[n,r]=t.useState(""),[j,l]=t.useState(""),i=async()=>{p(!0),l("");try{const e=await A({perPage:200,search:m,status:h});y(e.items),x(Object.fromEntries(e.items.map(a=>[a.id,a.admin_note||""])))}catch(e){l(e?.message||"İletişim mesajları yüklenemedi.")}finally{p(!1)}};t.useEffect(()=>{i()},[]);const d=async(e,a=e.status||"new")=>{r(e.id),l("");try{await E(e.id,{status:a,admin_note:u[e.id]||""}),await i()}catch(c){l(c?.message||"Mesaj güncellenemedi.")}finally{r("")}},N=async e=>{if(window.confirm(`“${e.subject}” konulu iletişim mesajı silinsin mi?`)){r(e.id),l("");try{await _(e.id),await i()}catch(a){l(a?.message||"Mesaj silinemedi.")}finally{r("")}}};return s.jsxs("div",{children:[s.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[s.jsx(T,{className:"h-7 w-7 text-sky-700"}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-black",children:"İletişim Mesajları"}),s.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Ziyaretçilerden gelen talepleri inceleyin ve işlem durumlarını yönetin."})]})]}),s.jsxs("form",{onSubmit:e=>{e.preventDefault(),i()},className:"mb-5 grid gap-2 sm:grid-cols-[1fr_220px_auto]",children:[s.jsxs("div",{className:"relative",children:[s.jsx(k,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"}),s.jsx("input",{className:"tr-input pl-10",value:m,onChange:e=>g(e.target.value),placeholder:"Ad, e-posta, konu veya mesaj ara..."})]}),s.jsxs("select",{className:"tr-input",value:h,onChange:e=>f(e.target.value),children:[s.jsx("option",{value:"",children:"Tüm durumlar"}),Object.entries(b).map(([e,a])=>s.jsx("option",{value:e,children:a},e))]}),s.jsx("button",{className:"tr-button-secondary",type:"submit",children:"Filtrele"})]}),j?s.jsx("div",{className:"mb-4 rounded-xl border border-red-200 bg-red-50 p-4 text-sm text-red-700",children:j}):null,v?s.jsx(S,{}):o.length?s.jsx("div",{className:"space-y-4",children:o.map(e=>s.jsx("article",{className:"tr-card overflow-hidden",children:s.jsxs("div",{className:"grid gap-5 p-5 xl:grid-cols-[minmax(0,1fr)_360px]",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("span",{className:"inline-flex rounded-full bg-sky-50 px-2.5 py-1 text-xs font-bold text-sky-700",children:b[e.status]||e.status||"Yeni"}),s.jsx("h2",{className:"mt-3 text-xl font-black",children:e.subject}),s.jsxs("p",{className:"mt-1 text-sm text-slate-500",children:[e.name," · ",e.email,e.phone?` · ${e.phone}`:""]})]}),s.jsx("span",{className:"text-xs text-slate-400",children:C(e.created)})]}),s.jsx("div",{className:"mt-5 whitespace-pre-wrap rounded-2xl bg-slate-50 p-4 text-sm leading-7 text-slate-700",children:e.message}),s.jsxs("p",{className:"mt-3 text-xs text-slate-400",children:["KVKK/onay kutusu: ",e.privacy_accepted?"Onaylandı":"Onay bilgisi yok"]})]}),s.jsxs("aside",{className:"rounded-2xl border bg-slate-50 p-4",children:[s.jsx("label",{className:"tr-label",children:"Yönetim notu"}),s.jsx("textarea",{className:"tr-input min-h-32 bg-white",value:u[e.id]||"",onChange:a=>x(c=>({...c,[e.id]:a.target.value}))}),s.jsxs("div",{className:"mt-4 grid gap-2",children:[s.jsxs("button",{type:"button",onClick:()=>d(e,e.status||"new"),className:"tr-button-secondary w-full",disabled:n===e.id,children:[s.jsx(L,{className:"h-4 w-4"})," Notu Kaydet"]}),s.jsx("button",{type:"button",onClick:()=>d(e,"reviewing"),className:"tr-button-secondary w-full",disabled:n===e.id,children:"İnceleniyor"}),s.jsxs("button",{type:"button",onClick:()=>d(e,"answered"),className:"tr-button w-full",disabled:n===e.id,children:[s.jsx(Y,{className:"h-4 w-4"})," Yanıtlandı"]}),s.jsxs("button",{type:"button",onClick:()=>d(e,"archived"),className:"tr-button-secondary w-full",disabled:n===e.id,children:[s.jsx(K,{className:"h-4 w-4"})," Arşivle"]}),s.jsxs("button",{type:"button",onClick:()=>N(e),className:"w-full rounded-xl border border-red-200 bg-white px-4 py-2.5 text-sm font-bold text-red-700 hover:bg-red-50",disabled:n===e.id,children:[s.jsx(I,{className:"mr-2 inline h-4 w-4"})," Sil"]})]})]})]})},e.id))}):s.jsx(M,{title:"İletişim mesajı bulunmuyor",description:"Seçtiğiniz filtreye uygun bir iletişim kaydı yok."})]})}
1export{F 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.