PageSourceSearch

https://sendunlimitedemail.com/sue/mod-CY0QT8_k.js

js sendunlimitedemail.com collected 2026-10-05 06:23:56 UTC 5,502 bytes, 1 lines download raw bytes

1import{f as m,b,r as l,j as e,H as y,L as d}from"./edge-BOITG1XR.js";function k(){const o=m(),{notify:r}=b(),[n,p]=l.useState(null),[a,c]=l.useState("all");function s(){const t=localStorage.getItem("token");if(!t){o("/auth/login?next=/notifications");return}fetch("/api/my/notifications",{headers:{Authorization:`Bearer ${t}`}}).then(i=>i.status===401?(o("/auth/login?next=/notifications"),null):i.json()).then(i=>i&&p(i))}l.useEffect(s,[o]);async function f(){const t=localStorage.getItem("token");await fetch("/api/my/notifications/read-all",{method:"POST",headers:{Authorization:`Bearer ${t}`}}),r({title:"All marked read",tone:"success"}),s()}async function u(t){if(t.read_at)return;const i=localStorage.getItem("token");await fetch(`/api/my/notifications/${t.id}/read`,{method:"POST",headers:{Authorization:`Bearer ${i}`}}),s()}async function g(t){const i=localStorage.getItem("token");await fetch(`/api/my/notifications/${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${i}`}}),s()}if(!n)return e.jsx(v,{children:"Loading…"});const x=a==="unread"?n.data.filter(t=>!t.read_at):n.data;return e.jsxs(e.Fragment,{children:[e.jsxs(y,{children:[e.jsx("title",{children:"Notifications | SendUnlimitedEmail"}),e.jsx("meta",{name:"robots",content:"noindex"})]}),e.jsx("section",{style:{padding:"32px 0 16px",background:"linear-gradient(180deg, #F8FAFC 0%, white 100%)",borderBottom:"1px solid var(--sue-border)"},children:e.jsxs("div",{className:"sue-container",style:{maxWidth:760},children:[e.jsx(d,{to:"/dashboard",style:{fontSize:13,color:"var(--sue-blue-600)",textDecoration:"none",fontWeight:600},children:"← Back to dashboard"}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:12,marginTop:12},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{fontSize:"clamp(22px, 3vw, 28px)",fontWeight:800,margin:0,letterSpacing:"-0.02em"},children:"Notifications"}),e.jsx("div",{style:{fontSize:13,color:"var(--sue-text-muted)",marginTop:4},children:n.unread_count>0?`${n.unread_count} unread`:"All caught up."})]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx(d,{to:"/profile?tab=notifications",className:"sue-btn sue-btn-outline sue-btn-sm",children:"Email preferences"}),n.unread_count>0&&e.jsx("button",{type:"button",onClick:f,className:"sue-btn sue-btn-primary sue-btn-sm",children:"Mark all read"})]})]})]})}),e.jsx("section",{style:{padding:"24px 0 64px"},children:e.jsxs("div",{className:"sue-container",style:{maxWidth:760},children:[e.jsxs("div",{style:{display:"flex",gap:6,marginBottom:16},children:[e.jsx(h,{label:`All (${n.data.length})`,active:a==="all",onClick:()=>c("all")}),e.jsx(h,{label:`Unread (${n.unread_count})`,active:a==="unread",onClick:()=>c("unread")})]}),x.length===0?e.jsxs("div",{style:{background:"white",border:"1px dashed var(--sue-border)",borderRadius:12,padding:40,textAlign:"center",color:"var(--sue-text-muted)"},children:[e.jsx("div",{style:{fontSize:32,marginBottom:8},children:"🔔"}),e.jsx("div",{style:{fontWeight:700,color:"var(--sue-text)"},children:a==="unread"?"No unread notifications.":"No notifications yet."}),e.jsx("div",{style:{fontSize:13,marginTop:6},children:"You'll see invoices, ticket replies, and service updates here."})]}):e.jsx("div",{style:{background:"white",border:"1px solid var(--sue-border)",borderRadius:12,overflow:"hidden"},children:x.map((t,i)=>e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"flex-start",padding:"14px 18px",borderTop:i===0?"none":"1px solid var(--sue-border)",background:t.read_at?"white":"var(--sue-blue-50, #EBF4FF)"},children:[e.jsx("span",{style:{width:36,height:36,borderRadius:"50%",background:`color-mix(in srgb, ${t.color} 14%, white)`,color:t.color,display:"grid",placeItems:"center",flexShrink:0,fontSize:14,fontWeight:800},children:t.icon||"i"}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8,flexWrap:"wrap"},children:[e.jsx("div",{style:{fontSize:14,fontWeight:700,color:"var(--sue-text)"},children:t.title}),e.jsx("span",{style:{fontSize:11.5,color:"var(--sue-text-subtle)"}
1,children:new Date(t.created_at).toLocaleString()})]}),t.body&&e.jsx("div",{style:{fontSize:13,color:"var(--sue-text-muted)",marginTop:4,lineHeight:1.5},children:t.body}),e.jsxs("div",{style:{display:"flex",gap:10,marginTop:8,alignItems:"center"},children:[t.link&&e.jsx(d,{to:t.link,onClick:()=>u(t),style:{fontSize:12.5,color:"var(--sue-blue-600)",fontWeight:600,textDecoration:"none"},children:"Open →"}),!t.read_at&&e.jsx("button",{type:"button",onClick:()=>u(t),style:{fontSize:12,color:"var(--sue-text-muted)",background:"none",border:"none",cursor:"pointer"},children:"Mark read"}),e.jsx("button",{type:"button",onClick:()=>g(t.id),style:{fontSize:12,color:"#94A3B8",background:"none",border:"none",cursor:"pointer",marginLeft:"auto"},children:"Delete"})]})]})]},t.id))})]})})]})}function h({label:o,active:r,onClick:n}){return e.jsx("button",{type:"button",onClick:n,style:{padding:"6px 14px",borderRadius:999,fontSize:12.5,fontWeight:600,background:r?"var(--sue-blue-600)":"white",color:r?"white":"var(--sue-text-muted)",border:`1px solid ${r?"var(--sue-blue-600)":"var(--sue-border)"}`,cursor:"pointer"},children:o})}function v({children:o}){return e.jsx("section",{style:{minHeight:"60vh",display:"grid",placeItems:"center"},children:e.jsx("div",{style:{color:"var(--sue-text-muted)"},children:o})})}export{k 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.