(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[576],{5801:(e,n,a)=>{"use strict";a.r(n),a.d(n,{default:()=>v});var l=a(4568),t=a(3605),s=a(4026),i=a(7620),d=a(9664),c=a.n(d),r=a(2982),o=a(5177),u=a(7823);function h(e){var n,a,t,s,d,h,v,x,j,g,m,b,p,k,N,f,w,y,R,z,B;let{guildId:C,enabled:S}=e,[_,E]=(0,i.useState)("open"),[I,M]=(0,i.useState)(""),A=(0,r.gf)("/guilds/".concat(C,"/tickets/views")),T=(0,r.gf)("/guilds/".concat(C,"/tickets/stats")),F=(0,r.gf)("/guilds/".concat(C,"/tickets/categories")),K=(0,r.gf)("/guilds/".concat(C,"/tickets?view=").concat(_).concat(I?"&categoryId=".concat(I):""));return(0,l.jsxs)("div",{className:"stack",children:[(0,l.jsxs)("div",{className:"grid",children:[(0,l.jsx)(o.ro,{label:"Offen",value:null!=(f=null==(n=T.data)?void 0:n.open)?f:"–",hint:"".concat(null!=(w=null==(a=T.data)?void 0:a.unclaimed)?w:0," nicht \xfcbernommen"),tone:(null!=(y=null==(t=T.data)?void 0:t.unclaimed)?y:0)>0?"warn":void 0}),(0,l.jsx)(o.ro,{label:"Geschlossen",value:null!=(R=null==(s=T.data)?void 0:s.closed)?R:"–",hint:"".concat(null!=(z=null==(d=T.data)?void 0:d.total)?z:0," insgesamt")}),(0,l.jsx)(o.ro,{label:"Reaktionszeit",value:(null==(h=T.data)?void 0:h.avgResponseMinutes)!=null?"".concat(T.data.avgResponseMinutes,"m"):"–",hint:"\xd8 bis zum \xdcbernehmen"}),(0,l.jsx)(o.ro,{label:"Bearbeitungszeit",value:(null==(v=T.data)?void 0:v.avgResolutionMinutes)!=null?"".concat(T.data.avgResolutionMinutes,"m"):"–",hint:"\xd8 bis zum Schliessen"}),(0,l.jsx)(o.ro,{label:"Zufriedenheit",value:(null==(x=T.data)?void 0:x.avgRating)!=null?"".concat(T.data.avgRating," / 5"):"–",hint:(null==(j=T.data)?void 0:j.ratingCount)?"aus ".concat(T.data.ratingCount," Bewertung(en)"):"noch keine Bewertung",tone:(null==(g=T.data)?void 0:g.avgRating)!=null&&T.data.avgRating<3?"warn":void 0})]}),(0,l.jsxs)(o.Zp,{title:"Tickets",actions:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("select",{className:"select",value:I,onChange:e=>M(e.target.value),style:{width:180},children:[(0,l.jsx)("option",{value:"",children:"alle Kategorien"}),null==(m=F.data)?void 0:m.map(e=>(0,l.jsx)("option",{value:e.id,children:e.label},e.id))]}),(0,l.jsx)(o.$n,{size:"sm",icon:(0,l.jsx)(u.H4,{}),onClick:K.reload,children:"Neu laden"})]}),children:[(0,l.jsx)("div",{className:"row",style:{marginBottom:"var(--sp-4)"},children:null==(b=A.data)?void 0:b.map(e=>(0,l.jsxs)("button",{className:_===e.key?"view-tab is-active":"view-tab",onClick:()=>{E(e.key),A.reload()},children:[e.label,(0,l.jsx)("span",{className:"view-count",children:e.count})]},e.key))}),K.loading&&(0,l.jsx)(o.EA,{rows:3}),K.error&&(0,l.jsx)(o.aV,{message:K.error}),(null==(p=K.data)?void 0:p.length)===0&&(0,l.jsx)(o.Sv,{icon:(0,l.jsx)(u.kr,{}),title:S?"open"===_?"Nichts offen":"Keine Tickets in dieser Ansicht":"Ticket-System ist aus",text:S?"Sobald jemand im Discord auf einen Panel-Button klickt, erscheint der Fall hier.":"Aktiviere das Modul oben, dann kann der erste Fall entstehen."}),(null!=(B=null==(k=K.data)?void 0:k.length)?B:0)>0&&(0,l.jsx)("div",{className:"table-wrap",children:(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:"Nr."}),(0,l.jsx)("th",{children:"Status"}),(0,l.jsx)("th",{children:"Kategorie"}),(0,l.jsx)("th",{children:"Ersteller"}),(0,l.jsx)("th",{children:"Bearbeitung"}),(0,l.jsx)("th",{children:"Ge\xf6ffnet"}),(0,l.jsx)("th",{})]})}),(0,l.jsx)("tbody",{children:null==(N=K.data)?void 0:N.map(e=>{var n,a,t;return(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{className:"num",children:e.displayId}),(0,l.jsx)("td",{children:(0,l.jsx)(o.qs,{status:e.status})}),(0,l.jsx)("td",{children:null!=(a=null==(n=e.category)?void 0:n.label)?a:"–"}),(0,l.jsx)("td",{className:"strong",children:null!=(t=e.openerTag)?t:e.openerId}),(0,l.jsx)("td",{children:e.assigneeName?(0,l.jsx)("span",{className:"pill pill-accent",title:"zugewiesen",children:e.assigneeName}):e.claimedById?(0,l.jsx)("span",{className:"pill",children:"\xfcbernommen"}):(0,l.jsx)("span",{className:"hint",children:"niemand"})}),(0,l.jsx)("td",{children:(0,o.om)(e.openedAt)}),(0,l.jsx)("td",{className:"right",children:(0,l.jsx)(c(),{href:"/dashboard/".concat(C,"/tickets/").concat(e.id),children:(0,l.jsx)(o.$n,{size:"sm",children:"\xd6ffnen"})})})]},e.id)})})]})})]})]})}function v(){let{guildId:e}=(0,t.xb)();return(0,l.jsx)(s.o,{active:"uebersicht",children:(n,a)=>(0,l.jsx)(h,{guildId:e,enabled:a})})}},8035:(e,n,a)=>{Promise.resolve().then(a.bind(a,5801))}},e=>{e.O(0,[664,214,26,587,18,358],()=>e(e.s=8035)),_N_E=e.O()}]);