PageSourceSearch

https://www.jepensioeninzicht.nl/assets/admin.email.index-CmgQe54d.js

js jepensioeninzicht.nl collected 2026-10-08 16:01:41 UTC 5,205 bytes, 1 lines download raw bytes

1import{v as i,a4 as c,w as l,V as q,r as P,j as e,t as a}from"./index-D-4mM6_C.js";import{u as O}from"./useQuery-CiLNtkKw.js";import{u as m}from"./useMutation-D4W54RSB.js";import{u as d}from"./useServerFn-B7WoRXjy.js";import{B as u}from"./button-C-djxg3E.js";import{B as C}from"./badge-utdRw85X.js";import{I as A}from"./input-BTidngoJ.js";import{T as Q,a as B,b as x,c as r,d as K,e as n}from"./table-DDmbNaXI.js";const V=i({method:"GET"}).middleware([c]).handler(l("4aecc27cd328761ab99ae44c04cd1fd3fe5827eb06d4bf6045b9583414c85ab1")),I=i({method:"POST"}).middleware([c]).handler(l("5dbd4b59b2b8017e8454bd5cf3828a5b1cbfac39cf4d3bf75c15a1ebc5e29307")),M=i({method:"POST"}).middleware([c]).handler(l("6228b7a9eaf20adc522bd9fddb1c76465fe2a77270d1b9b60de79701eeb03aba")),R=i({method:"POST"}).middleware([c]).handler(l("883b4a5d3550d7a4c8a9d9858b9e446a858e108659e663568fc0330b8be1129a")),$=i({method:"POST"}).middleware([c]).handler(l("e16b6563787c240bbb4cb11881e4c937643d58a83dd50f5a240030e397e50be5")),H=i({method:"POST"}).middleware([c]).handler(l("cf27b7201ed5baf4b0c0d1ff7dcdafece8ac1ab2073f48cd9feb95628b5c9d50")),L={queued:"default",sent:"secondary",failed:"destructive"};function ee(){const w=q(),N=d(V),S=d(I),z=d(M),E=d(R),F=d($),[h,b]=P.useState(""),j=O({queryKey:["email-queue"],queryFn:()=>N({}),refetchInterval:15e3}),p=j.data?.rows??[],t=j.data?.state??null,o=()=>w.invalidateQueries({queryKey:["email-queue"]}),g=m({mutationFn:s=>S({data:{to:s}}),onSuccess:()=>{a.success("Testmail staat in de wachtrij."),b(""),o()},onError:s=>a.error(s.message)}),f=m({mutationFn:()=>z({}),onSuccess:s=>{a.success(`Keuzehulp-testmail staat klaar voor ${s.to}.`),o()},onError:s=>a.error(s.message)}),_=m({mutationFn:s=>E({data:{id:s}}),onSuccess:()=>{a.success("Opnieuw in de wachtrij gezet."),o()},onError:s=>a.error(s.message)}),v=m({mutationFn:()=>F({}),onSuccess:()=>{a.success("Verzending hervat."),o()},onError:s=>a.error(s.message)}),y=d(H),T=m({mutationFn:s=>y({data:{enabled:s}}),onSuccess:(s,k)=>{a.success(k?"Testmodus aan.":"Testmodus uit — live verzending."),o()},onError:s=>a.error(s.message)});return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"E-mail"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Alle uitgaande e-mail loopt via de wachtrij en wordt verstuurd via Mailjet vanaf [email protected]."})]}),t&&e.jsxs("div",{className:`rounded-md border p-4 text-sm ${t.test_mode?"border-accent bg-accent/20":"border-border"}`,children:[e.jsxs("p",{className:"font-medium",children:["Testmodus: ",t.test_mode?"AAN":"uit"]}),e.jsx("p",{className:"text-muted-foreground",children:t.test_mode?`Alle mails gaan naar ${t.test_recipient}. Onderwerp en een gele balk tonen de echte ontvanger.`:"Mails gaan naar de echte ontvangers (cursisten, aanbieders, support)."}),e.jsx(u,{className:"mt-3",size:"sm",variant:t.test_mode?"outline":"default",onClick:()=>T.mutate(!t.test_mode),disabled:T.isPending,children:t.test_mode?"Testmodus uitschakelen (live)":"Testmodus inschakelen"})]}),t?.paused&&e.jsxs("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-4 text-sm",children:[e.jsx("p",{className:"font-medium",children:"Verzending is gepauzeerd"}),e.jsx("p",{className:"text-muted-foreground",children:t.pause_reason}),e.jsx(u,{className:"mt-3",size:"sm",onClick:()=>v.mutate(),disabled:v.isPending,children:"Verzending hervatten"})]}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsxs("div",{className:"w-72",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium",htmlFor:"testto",children:"Testmail sturen naar"}),e.jsx(A,{id:"testto",type:"email",value:h,placeholder:"[email protected]",onChange:s=>b(s.target.value)})]}),e.jsx(u,{onClick:()=>g.mutate(h),disabled:!h||g.isPending,children:"Testmail in wachtrij zetten"}),e.jsx(u,{variant:"outline",onClick:()=>f.mutate(),disabled:f.isPending,children:"Keuzehulp-testmail versturen"})]}),e.jsxs(Q,{children:[e.jsx(B,{children:e.jsxs(x,{children:[e.jsx(r,{children:"Ontvanger"}),e.jsx(r,{children:"Onderwerp"}),e.jsx(r,{children:"Bcc"}),e.jsx(r,{children:"Sjabloon"}),e.jsx(r,{children:"Status"}),e.jsx(r,{children:"Pogingen"}),e.jsx(r,{children:"Aangemaakt"}),e.jsx(r,{})]})}),e.jsxs(K,{children:[p.length===0&&e.jsx(x,{children:e.jsx(n,{colSpan:8,className:"text-muted-foreground",children:"Nog geen e-mails in de wachtrij."})}),p.map(s=>e.jsxs(x,{children:[e.jsx(n,{children:s.to_email}),e.jsx(n,{className:"max-w-[280px] truncate",children:s.subject}),e.jsx(n,{className:"text-muted-foreground",children:s.bcc_email??"—"}),e.jsx(n,{children:s.template??"—"}),e.jsxs(n,{children:[e.jsx(C,{variant:L[s.status]??"outline",children:s.status}),s.last_error&&e.jsx("div",{className:"mt-1 max-w-[280px] truncate text-xs text-muted-foreground",title:s.last_error,children:s.last_error})]}),e.jsx(n,{children:s.attempts}
1),e.jsx(n,{children:new Date(s.created_at).toLocaleString("nl-NL")}),e.jsx(n,{className:"text-right",children:s.status!=="sent"&&e.jsx(u,{variant:"outline",size:"sm",onClick:()=>_.mutate(s.id),children:"Opnieuw"})})]},s.id))]})]})]})}export{ee 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.