PageSourceSearch

https://trybrain.io/assets/_authenticated.organic-inbox-Dt7ffid1.js

js trybrain.io collected 2026-09-24 15:05:09 UTC 3,130 bytes, 1 lines download raw bytes

1import{e as r,P as v,f as i,j as e,az as j,aA as g,aB as d,aC as l,k as c}from"./index-DHwBXtP2.js";import{l as f,a as y}from"./instagram-autoreply.functions-CjKCbyCk.js";function w(){const o=r(v),{data:x}=i({queryKey:["workspaces"],queryFn:()=>o({})}),t=x?.[0]?.id,m=r(f),u=r(y),{data:p}=i({queryKey:["ig-auto-replies",t],queryFn:()=>m({data:{workspaceId:t}}),enabled:!!t,refetchInterval:15e3}),{data:h}=i({queryKey:["ig-webhook-events",t],queryFn:()=>u({data:{workspaceId:t}}),enabled:!!t,refetchInterval:15e3}),n=p?.replies??[],a=h?.events??[];return e.jsxs("section",{className:"space-y-4 max-w-5xl",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:"Organic inbox"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Live feed of comments and DMs Meta forwarded, plus every AI reply and DM the assistant sent."})]}),e.jsxs(j,{defaultValue:"replies",children:[e.jsxs(g,{children:[e.jsxs(d,{value:"replies",children:["AI replies (",n.length,")"]}),e.jsxs(d,{value:"events",children:["Raw events (",a.length,")"]})]}),e.jsx(l,{value:"replies",className:"space-y-2 mt-4",children:n.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No replies yet. Turn on auto-reply in Settings → Instagram and connect the Meta webhook."}):n.map(s=>e.jsxs("div",{className:"rounded-lg border p-3 text-sm space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"font-medium",children:["@",s.from_username??"unknown"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(c,{variant:"outline",children:s.intent??"unknown"}),e.jsxs(c,{variant:s.status==="sent"?"default":s.status==="failed"?"destructive":"secondary",children:[s.reply_channel," · ",s.status]})]})]}),s.inbound_text&&e.jsxs("div",{className:"text-muted-foreground",children:['"',s.inbound_text,'"']}),e.jsxs("div",{children:["↳ ",s.reply_text]}),s.error&&e.jsxs("div",{className:"text-xs text-destructive",children:["Error: ",s.error]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:new Date(s.created_at).toLocaleString()})]},s.id))}),e.jsx(l,{value:"events",className:"space-y-2 mt-4",children:a.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No webhook events received yet. Once Meta accepts your callback URL, new comments and DMs will land here within seconds."}):a.map(s=>e.jsxs("div",{className:"rounded-lg border p-3 text-sm space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"font-medium",children:["@",s.from_username??"—"," · ",s.object_type]}),e.jsx(c,{variant:s.processed_at?"secondary":"outline",children:s.processed_at?"processed":"pending"})]}),s.text_content&&e.jsx("div",{className:"text-muted-foreground",children:s.text_content}),s.processing_error&&e.jsx("div",{className:"text-xs text-destructive",children:s.processing_error}),e.jsx("div",{className:"text-xs text-muted-foreground",children:new Date(s.received_at).toLocaleString()})]},s.id))})]})]})}export{w 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.