PageSourceSearch

https://app.superlemon.xyz/assets/ShopifyFlowDetail-BgtqVZpX.js

js superlemon.xyz collected 2026-10-01 11:28:55 UTC 4,467 bytes, 1 lines download raw bytes

1import{a as E,b as I,u as R,al as B,r as y,ab as l,j as e,am as w,G as g,l as A,h as n,ai as h,i as j,aB as F,aC as o}from"./index-BqA-Im5G.js";import{u as O}from"./useQuery-k4-pVA0d.js";import{P as T}from"./PageMarkup-Bap8ablw.js";import{C as K}from"./Chart-CpTmojA8.js";import{D as H}from"./DateRangePicker-BOulO_38.js";import{a as G}from"./shopifyFlowCampaigns-C5XC8xXg.js";import{s as i}from"./automation.module-C_ma5ftl.js";import{C as q}from"./Card-Z8g6ZOE-.js";import{D as U}from"./DataTable-Cvx9KwqJ.js";import"./InfoIcon.svg-BFzxkXte.js";import"./PageHeader-CPZUGqb5.js";import"./CartesianChart-D19wlDHj.js";const $=s=>{if(!s)return"—";switch(s.toUpperCase()){case"DELIVERED":return e.jsx(o,{tone:"success",children:"Delivered"});case"READ":return e.jsx(o,{tone:"info",children:"Read"});case"SENT":return e.jsx(o,{tone:"attention",children:"Sent"});case"FAILED":return e.jsx(o,{tone:"critical",children:"Failed"});case"DISPATCHED":return e.jsx(o,{children:"Dispatched"});default:return e.jsx(o,{children:s})}},D=s=>s?l(s).format("DD MMM, HH:mm"):"—",S=20,ne=()=>{const{shopDetailsData:s}=E(I(a=>({shopDetailsData:a.shopDetailsData}))),M=R(),{campaignId:m}=B(),[d,b]=y.useState({startDate:l().subtract(29,"days").format("YYYY-MM-DD"),endDate:l().format("YYYY-MM-DD")}),[c,x]=y.useState(0),{data:u,isFetching:f}=O({queryKey:["shopify-flow-detail",s==null?void 0:s.userId,m,d.startDate,d.endDate,c],queryFn:()=>G(s.userId,m,d.startDate,d.endDate,c,S),enabled:!!(s!=null&&s.userId&&m)}),t=u==null?void 0:u.campaign,r=t==null?void 0:t.campaign,C=(t==null?void 0:t.graph)||[],v=(t==null?void 0:t.logs)||[],Y=(t==null?void 0:t.totalLogs)??0,p=Math.ceil(Y/S),N=[{dataKey:"sent",label:"Sent",stroke:"#f2cc52"},{dataKey:"delivered",label:"Delivered",stroke:"#f61613"},{dataKey:"read",label:"Read",stroke:"#ad7ffd"}],k=v.map(a=>[a.phone||"—",$(a.externalStatus||a.providerStatus||a.status),D(a.sentOn),D(a.deliveredOn),D(a.readOn),a.errorMessage||"—"]),L=e.jsxs("div",{className:i.topBar,children:[e.jsx("div",{}),e.jsx(H,{startDate:d.startDate,endDate:d.endDate,onChange:(a,P)=>{b({startDate:l(a).format("YYYY-MM-DD"),endDate:l(P).format("YYYY-MM-DD")}),x(0)}})]});return f&&!t?e.jsx(w,{variant:"inline",note:"Loading campaign details..."}):e.jsx(T,{pageClassName:"sl-templates-page",children:e.jsxs("div",{className:i.layout,children:[e.jsx(g,{align:"space-between",blockAlign:"center",children:e.jsx(A,{variant:"plain",onClick:()=>M.push("/automations"),children:"← Back to Automations"})}),r&&e.jsx(n,{as:"h2",variant:"headingLg",children:r.name}),L,r&&e.jsxs("div",{className:i.summaryGrid,children:[e.jsx("div",{className:i.summaryCard,children:e.jsxs(h,{sectioned:!0,children:[e.jsx(n,{as:"p",tone:"subdued",children:"Sent"}),e.jsx(n,{as:"h3",variant:"headingLg",children:Math.max(r.sent,r.delivered,r.read)})]})}),e.jsx("div",{className:i.summaryCard,children:e.jsxs(h,{sectioned:!0,children:[e.jsx(n,{as:"p",tone:"subdued",children:"Delivered"}),e.jsx(n,{as:"h3",variant:"headingLg",children:Math.max(r.delivered,r.read)})]})}),e.jsx("div",{className:i.summaryCard,children:e.jsxs(h,{sectioned:!0,children:[e.jsx(n,{as:"p",tone:"subdued",children:"Read"}),e.jsx(n,{as:"h3",variant:"headingLg",children:r.read})]})}),e.jsx("div",{className:i.summaryCard,children:e.jsxs(h,{sectioned:!0,children:[e.jsx(n,{as:"p",tone:"subdued",children:"Failed"}),e.jsx(n,{as:"h3",variant:"headingLg",children:r.failed})]})})]}),e.jsxs("div",{className:i.trendSection,children:[e.jsx(g,{align:"space-between",blockAlign:"center",children:e.jsx(n,{as:"h3",variant:"headingMd",children:"Campaign trend"})}),e.jsx(j,{paddingBlockStart:"300",children:e.jsx(K,{data:C,lines:N,xDataKey:"date"})})]}),e.jsxs("div",{className:i.logsSection,children:[e.jsx(n,{as:"h3",variant:"headingMd",children:"Message Report"}),e.jsx(j,{paddingBlockStart:"300",children:e.jsxs(q,{children:[e.jsxs("div",{className:i.tableArea,children:[e.jsx(U,{columnContentTypes:["text","text","text","text","text","text"],headings:["Phone","Status","Sent On","Delivered On","Read On","Error"],rows:k}),v.length===0&&!f&&e.jsx("div",{style:{padding:"24px 16px",textAlign:"center"},children:e.jsx(n,{as:"p",tone:"subdued",children:"No messages found for this date range."})})]}),p>1&&e.jsx(j,{padding:"400",children:e.jsx(g,{align:"center",children:e.jsx(F,{hasPrevious:c>0,hasNext:c<p-1,onPrevious:()=>x(a=>a-1),onNext:()=>x(a=>a+1),label:`Page ${c+1} of ${p}`})})})]})})]})]})})};export{ne 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.