PageSourceSearch

https://digitalbehandling.se/assets/StatusDisputesAdmin-_CmBCL1Q.js

js digitalbehandling.se collected 2026-09-30 08:27:28 UTC 2,253 bytes, 1 lines download raw bytes

1import{a2 as x,x as p,j as e,C as c,a as o,c as h,d as j,k as f,B as m}from"./index-CobRY8C4.js";import"./ProfileChangeRequestCard-UGJ4LAvw.js";import"./ClientFormFields-107a_yyD.js";import{u as g,f as v}from"./useStatusDispute-BOGZirPV.js";import"./useProfileChangeRequests-D-eRCPl_.js";import"./clientStatus-DF5CMPjw.js";function w(){const{data:a,isLoading:n,refetch:u}=x({queryKey:["admin-disputes"],queryFn:async()=>(await v()).map(t=>({...t,client:Array.isArray(t.clients)?t.clients[0]:t.clients}))}),i=g(),{toast:l}=p(),d=async(s,t)=>{const r=await i.mutateAsync({disputeId:s,outcome:t});r.ok?(l({title:t==="restored"?"Klient återställd":"Bestridande avskrivet"}),u()):l({title:"Misslyckades",description:r.error,variant:"destructive"})};return e.jsxs("div",{className:"container max-w-4xl space-y-6 py-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Status-bestridanden"}),e.jsx("p",{className:"text-muted-foreground",children:"Klienter som har markerat att deras statusuppgift är felaktig."})]}),n&&e.jsx("p",{children:"Laddar…"}),!n&&((a==null?void 0:a.length)??0)===0&&e.jsx(c,{children:e.jsx(o,{className:"py-12 text-center text-muted-foreground",children:"Inga öppna bestridanden."})}),a==null?void 0:a.map(s=>{var t,r;return e.jsxs(c,{children:[e.jsx(h,{children:e.jsxs(j,{className:"flex items-center gap-2",children:[(t=s.client)==null?void 0:t.first_name," ",(r=s.client)==null?void 0:r.last_name,e.jsxs(f,{variant:"destructive",children:["Bestrider: ",s.disputed_status]})]})}),e.jsxs(o,{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Klienten hävdar status:"})," ",s.claimed_status]}),s.reason&&e.jsxs("p",{className:"text-sm bg-muted p-2 rounded",children:['"',s.reason,'"']}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Inkommen: ",new Date(s.created_at).toLocaleString("sv-SE")]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsxs(m,{onClick:()=>d(s.id,"restored"),disabled:i.isPending,children:["Återställ till ",s.claimed_status]}),e.jsx(m,{variant:"outline",onClick:()=>d(s.id,"confirmed_correct"),disabled:i.isPending,children:"Uppgiften är korrekt"})]})]})]},s.id)})]})}export{w 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.