1import{l as e}from"./index-BCz1FotW.js";import"./vendor-dnd-D7Z1dhuR.js";import{W as N,I as o,q as f,T as $,c as T}from"./App-TdcU-xIC.js";import{g as y,d as C,f as O,a as k,B as D}from"./useMarketplaceSettings-C77VSiH-.js";import"./notificationsService-4XLc8WSw.js";const R=({data:v,onViewAll:g})=>{const{incoming:h,closed:w,open:z,overdueCount:d,overdueList:n,resolutionRate:r,byCategory:c,byPriority:b,avgResolutionTime:j,recentTickets:x}=v||{},i=h||0,a=(d||0)>0,u={maintenance:{bg:"bg-blue-100",text:"text-blue-700",icon:N},cleaning:{bg:"bg-green-100",text:"text-green-700",icon:y},technical:{bg:"bg-purple-100",text:"text-purple-700",icon:T},other:{bg:"bg-gray-100",text:"text-gray-700",icon:o}},p={high:{color:"text-red-600",bg:"bg-red-500",label:"Yüksek"},medium:{color:"text-yellow-600",bg:"bg-yellow-500",label:"Orta"},low:{color:"text-green-600",bg:"bg-green-500",label:"DüÅük"}};return e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm h-[420px] flex flex-col overflow-hidden border-gray-200 shadow-sm overflow-hidden",children:[e.jsxs("div",{className:`p-4 ${a?"bg-gradient-to-r from-cyan-500 to-cyan-600":"bg-gradient-to-r from-cyan-400 to-cyan-500"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white",children:[e.jsx(N,{size:20}),e.jsx("h3",{className:"font-semibold",children:"Operasyon Ãzeti"})]}),g&&e.jsx("button",{onClick:g,className:"text-xs text-white/80 hover:text-white transition",children:"Tümünü Gör â"})]}),e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"text-cyan-100 text-xs mb-1",children:"Toplam Talep"}),e.jsxs("div",{className:"flex items-end gap-3",children:[e.jsx("span",{className:"text-3xl font-bold text-white",children:i}),e.jsx("span",{className:"text-cyan-100 mb-1",children:"adet"}),j&&e.jsxs("span",{className:"text-cyan-200 text-sm mb-1 ml-2",children:["(Ort. ",j," saat çözüm)"]})]})]})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-2 mb-4",children:[e.jsxs("div",{className:"text-center p-2 bg-blue-50 rounded-lg",children:[e.jsx(o,{size:16,className:"text-blue-500 mx-auto mb-1"}),e.jsx("div",{className:"text-xl font-bold text-blue-700",children:h||0}),e.jsx("div",{className:"text-xs text-blue-500",children:"Gelen"})]}),e.jsxs("div",{className:"text-center p-2 bg-green-50 rounded-lg",children:[e.jsx(y,{size:16,className:"text-green-500 mx-auto mb-1"}),e.jsx("div",{className:"text-xl font-bold text-green-700",children:w||0}),e.jsx("div",{className:"text-xs text-green-500",children:"Kapanan"})]}),e.jsxs("div",{className:"text-center p-2 bg-yellow-50 rounded-lg",children:[e.jsx(C,{size:16,className:"text-yellow-500 mx-auto mb-1"}),e.jsx("div",{className:"text-xl font-bold text-yellow-700",children:z||0}),e.jsx("div",{className:"text-xs text-yellow-500",children:"Açık"})]}),e.jsxs("div",{className:`text-center p-2 rounded-lg ${a?"bg-red-50":"bg-gray-50"}`,children:[e.jsx(f,{size:16,className:`mx-auto mb-1 ${a?"text-red-500":"text-gray-400"}`}),e.jsx("div",{className:`text-xl font-bold ${a?"text-red-700":"text-gray-400"}`,children:d||0}),e.jsx("div",{className:`text-xs ${a?"text-red-500":"text-gray-400"}`,children:"Geciken"})]})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[e.jsxs("span",{className:"text-gray-600 flex items-center gap-1",children:[e.jsx($,{size:14}),"Ãözüm Oranı"]}),e.jsxs("span",{className:"font-bold text-cyan-600",children:["%",r||0]})]}),e.jsx("div",{className:"w-full h-3 bg-gray-100 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${(r||0)>=80?"bg-green-500":(r||0)>=50?"bg-cyan-500":"bg-yellow-500"}`,style:{width:`${r||0}%`}})}),e.jsxs("div",{className:"flex justify-between text-xs text-gray-400 mt-1",children:[e.jsx("span",{children:"0%"}),e.jsx("span",{children:"50%"}),e.jsx("span",{children:"100%"})]})]}),b&&e.jsxs("div",{className:"mb-4 p-3 bg-gray-50 rounded-lg",children:[e.jsx("h4",{className:"text-xs font-medium text-gray-500 mb-2",children:"Ãncelik DaÄılımı"}),e.jsx("div",{className:"flex gap-2",children:Object.entries(b).map(([s,l])=>{const t=p[s]||p.low,m=i>0?Math.round(l/i*100):0;return e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[e.jsx("span",{className:t.color,children:t.label}),e.jsx("span",{className:"text-gray-600",children:l})]}),e.jsx("div",{className:"w-full h-2 bg-gray-200 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full ${t.bg} rounded-full`,style:{width:`${m}%`}})})]},s)})})]}),c&&Object.keys(c).length>0&&e.jsxs("div",{className:"mb-4 p-3 bg-gray-50 rounded-lg",children:[e.jsx("h4",{className:"text-xs font-medium text-gray-500 mb-2",children:"Kategori DaÄılımı"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:Object.entries(c).slice(0,4).map(([s,l])=>{const t=u[s]||u.other,m=t.icon;return e.jsxs("div",{className:`flex items-center gap-2 p-2 rounded ${t.bg}`,children:[e.jsx(m,{size:14,className:t.text}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("div",{className:`text-xs font-medium ${t.text} truncate capitalize`,children:s})}),e.jsx("span",{className:`text-sm font-bold ${t.text}`,children:l})]},s)})})]}),a&&n&&n.length>0&&e.jsxs("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("span",{className:"text-sm font-medium text-red-700 flex items-center gap-2",children:[e.jsx(f,{size:14}),"Geciken Talepler"]}),e.jsxs("span",{className:"text-xs text-red-500",children:[d," adet"]})]}),e.jsxs("div",{className:"space-y-2",children:[n.slice(0,4).map((s,l)=>{var t;return e.jsxs("div",{className:"flex items-center justify-between p-2 bg-white rounded border border-red-100",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(O,{size:14,className:"text-red-400 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-red-700 truncate",children:s.ticket_no||`#${(t=s.id)==null?void 0:t.slice(0,6)}`}),e.jsx("div",{className:"text-xs text-red-400 truncate",children:s.subject||s.title})]})]}),e.jsxs("div",{className:"text-xs font-bold text-white bg-red-500 px-2 py-1 rounded flex-shrink-0",children:[s.overdueDays," gün"]})]},l)}),n.length>4&&e.jsxs("div",{className:"text-xs text-red-500 text-center pt-1",children:["+",n.length-4," daha..."]})]})]}),x&&x.length>0&&e.jsxs("div",{className:"p-3 bg-cyan-50 border border-cyan-200 rounded-lg",children:[e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsxs("span",{className:"text-sm font-medium text-cyan-700 flex items-center gap-2",children:[e.jsx(k,{size:14}),"Son Talepler"]})}),e.jsx("div",{className:"space-y-2",children:x.slice(0,3).map((s,l)=>e.jsxs("div",{className:"flex items-center justify-between p-2 bg-white rounded border border-cyan-100",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(D,{size:14,className:"text-cyan-400 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-cyan-700 truncate",children:s.office_code||s.branch}),e.jsx("div",{className:"text-xs text-cyan-500 truncate",children:s.subject||s.title})]})]}),e.jsx("div",{className:`text-xs px-2 py-1 rounded ${s.status==="open"?"bg-yellow-100 text-yellow-700":s.status==="in_progress"?"bg-blue-100 text-blue-700":"bg-green-100 text-green-700"}`,children:s.status==="open"?"Açık":s.status==="in_progress"?"İÅlemde":"Kapalı"})]},l))})]}),i===0&&e.jsxs("div",{className:"text-center py-6 text-gray-400",children:[e.jsx(o,{size:48,className:"mx-auto mb-3 text-gray-300"}),e.jsx("p",{className:"text-gray-500",children:"Aktif talep bulunmuyor"}),e.jsx("p",{className:"text-sm text-gray-400 mt-1",children:"Tüm talepler tamamlandı"})]})]})]})};export{R 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.