PageSourceSearch

https://simpleresponder.de/assets/loop-emails.index-sPZeyZzo.js

js simpleresponder.de collected 2026-10-09 22:04:09 UTC 3,967 bytes, 1 lines download raw bytes

1import{y as E,u as I,r as p,j as e,L as h,t as T}from"./index-BjROZu-y.js";import{u as w}from"./useQuery-BKwbzsdF.js";import{u as n}from"./useServerFn-6mtYaOeL.js";import{u as D}from"./use-current-workspace-CeVx6BzL.js";import{l as F,d as M,t as B,c as R}from"./loop-emails.functions-Bl7fSA7E.js";import{B as i}from"./button-jAwp458t.js";import{B as A}from"./badge-CdrzAnT5.js";import{C as q,a as z,b as S,d as H}from"./card-1tQB7wJr.js";import{T as K,a as Q,b as x,c as t,d as W,e as r}from"./table-BaYmr2Jw.js";import{I as $}from"./input-D8ltPcu6.js";import{D as O,f as P,a as _,b as G,c as J,e as U}from"./dialog-CTN1rHiQ.js";import{L as V}from"./label-CCIEJ2c4.js";import{u as X}from"./confirm-dialog-B2LAoOAX.js";import"./index-BO-M6IvO.js";import"./index-LHNt3CwB.js";import"./utils-BQHNewu7.js";import"./index-BP8JKLDr.js";import"./index-BlGddTbp.js";import"./index-LwKlC5vL.js";import"./index-3lTj5ZWs.js";import"./index-B6e5pELl.js";import"./x-CuRVTk-Y.js";import"./createLucideIcon-DRj5qHaH.js";import"./alert-dialog-BvcttIfA.js";function be(){const{data:s}=D(),u=E(),j=I(),f=n(F),g=n(M),v=n(B),C=n(R),[N,d]=p.useState(!1),[l,c]=p.useState(""),{askConfirm:b,confirmDialog:k}=X(),{data:o,isLoading:y}=w({queryKey:["loop-emails",s?.id],enabled:!!s,queryFn:()=>f({data:{workspaceId:s.id}})}),m=()=>u.invalidateQueries({queryKey:["loop-emails",s?.id]}),L=async()=>{if(!(!s||!l.trim()))try{const a=await C({data:{workspaceId:s.id,name:l.trim()}});d(!1),c(""),j({to:"/loop-emails/$loopEmailId/",params:{loopEmailId:a.id}})}catch(a){T.error(a instanceof Error?a.message:"Fehler")}};return e.jsxs("div",{className:"mx-auto max-w-6xl space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Reminder Mails"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Wiederkehrende Mails an Kontakte, die alle Sequenzen abgeschlossen haben."})]}),e.jsxs(O,{open:N,onOpenChange:d,children:[e.jsx(P,{asChild:!0,children:e.jsx(i,{children:"Neue Reminder Mail"})}),e.jsxs(_,{children:[e.jsx(G,{children:e.jsx(J,{children:"Neue Reminder Mail"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Name"}),e.jsx($,{value:l,onChange:a=>c(a.target.value),placeholder:"z. B. Monatlicher Tipp"})]}),e.jsx(U,{children:e.jsx(i,{onClick:L,children:"Anlegen"})})]})]})]}),e.jsxs(q,{children:[e.jsx(z,{children:e.jsx(S,{children:"Alle Reminder Mails"})}),e.jsx(H,{children:y?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Lädt …"}):!o||o.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Noch keine Reminder Mails angelegt."}):e.jsxs(K,{children:[e.jsx(Q,{children:e.jsxs(x,{children:[e.jsx(t,{children:"Name"}),e.jsx(t,{children:"Betreff"}),e.jsx(t,{children:"Status"}),e.jsx(t,{children:"Intervall"}),e.jsx(t,{className:"text-right",children:"Aktionen"})]})}),e.jsx(W,{children:o.map(a=>e.jsxs(x,{children:[e.jsx(r,{children:e.jsx(h,{to:"/loop-emails/$loopEmailId/",params:{loopEmailId:a.id},className:"font-medium hover:underline",children:a.name})}),e.jsx(r,{className:"max-w-xs truncate",children:a.subject||"—"}),e.jsx(r,{children:e.jsx(A,{variant:a.active?"default":"outline",children:a.active?"Aktiv":"Inaktiv"})}),e.jsxs(r,{children:[a.interval_days," Tage"]}),e.jsxs(r,{className:"text-right space-x-2",children:[e.jsx(i,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(h,{to:"/loop-emails/$loopEmailId/",params:{loopEmailId:a.id},children:"Öffnen"})}),e.jsx(i,{size:"sm",variant:"outline",onClick:async()=>{await v({data:{id:a.id,active:!a.active}}),m()},children:a.active?"Deaktivieren":"Aktivieren"}),e.jsx(i,{size:"sm",variant:"destructive",onClick:()=>b({title:"Loop-Mail löschen?",description:"Wirklich löschen?",confirmLabel:"Löschen",destructive:!0,action:async()=>{await g({data:{id:a.id}}),m()}}),children:"Löschen"})]})]},a.id))})]})})]}),k]})}export{be 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.