PageSourceSearch

https://primaryhub.ai/assets/Integrations-CAc7wMUM-b1790897239410093205.js

js primaryhub.ai collected 2026-10-05 13:57:35 UTC 6,118 bytes, 1 lines download raw bytes

1import{u as T,a8 as q,r as u,n as x,j as e,aJ as P,q as p,s as h}from"./index-DoLX-udD-b1790897239410093205.js";import{P as E}from"./PageShell-DWsONjWJ-b1790897239410093205.js";import{P as A}from"./PageHeader-CpJ54b2a-b1790897239410093205.js";import{a as M,b as K}from"./queries-CCBP_0HX-b1790897239410093205.js";import{u as O}from"./queries-BbsFKXQQ-b1790897239410093205.js";import{I as C,a as R}from"./integrationsCatalog-eGgc0Nmm-b1790897239410093205.js";import{A as B}from"./arrow-right-_jye1GjK-b1790897239410093205.js";import{C as L}from"./check-CoDtNqYw-b1790897239410093205.js";import"./tags-C2qrJ65a-b1790897239410093205.js";import"./useInfiniteQuery-CFfZIO3l-b1790897239410093205.js";const $=({integration:r,size:t=46})=>{const{logo:a,color:c,name:i}=r;return a?e.jsx("span",{className:"flex shrink-0 items-center justify-center rounded-xl border border-border bg-surface",style:{width:t,height:t},children:e.jsx(a,{style:{width:t*.58,height:t*.58}})}):e.jsx("span",{className:"flex shrink-0 items-center justify-center rounded-xl font-bold text-white",style:{width:t,height:t,backgroundColor:c,fontSize:t*.42},children:i[0]})},F=({connected:r,count:t,comingSoon:a})=>a?e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-amber-200 bg-amber-50 px-2.5 py-1 text-[11px] font-semibold text-amber-700",children:[e.jsx("span",{className:"size-1.5 rounded-full bg-amber-500"}),"Coming soon"]}):t>0?e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-emerald-200 bg-emerald-50 px-2.5 py-1 text-[11px] font-semibold text-emerald-700",children:[e.jsx("span",{className:"size-1.5 rounded-full bg-emerald-500"}),t," active"]}):r?e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-emerald-200 bg-emerald-50 px-2.5 py-1 text-[11px] font-semibold text-emerald-700",children:[e.jsx(L,{className:"size-3"}),"Connected"]}):null,G=(r,t)=>{if(t)return r.kind==="external"?"Open":"Manage";switch(r.kind){case"automation":return"Set up";case"external":return"Open";case"webhooks":return"Add webhook";default:return"Connect"}},H=({integration:r,connected:t,count:a,comingSoon:c,onOpen:i})=>e.jsxs("button",{type:"button",onClick:i,className:"group flex h-full flex-col rounded-2xl border border-border bg-surface p-5 text-left shadow-sm transition hover:border-custom-blue/40 hover:shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-custom-blue/40",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx($,{integration:r}),e.jsx(F,{connected:t,count:a,comingSoon:c})]}),e.jsx("h3",{className:"mt-4 text-[15px] font-semibold text-text-primary",children:r.name}),e.jsx("p",{className:"mt-1 line-clamp-2 text-[12.5px] leading-5 text-text-secondary",children:r.short}),e.jsxs("span",{className:`mt-4 inline-flex items-center gap-1.5 text-[12px] font-semibold ${c?"text-text-secondary":"text-custom-blue"}`,children:[c?"Coming soon":G(r,t),!c&&e.jsx(B,{className:"size-3.5 transition-transform group-hover:translate-x-0.5"})]})]}),Z=()=>{const r=T(),t=q(),[a,c]=u.useState(""),{data:i}=M(t),f=i?.configs||[],{data:S}=K(),{data:b}=O(),y=u.useMemo(()=>(b?.pages||[]).flatMap(s=>s?.webhooks||[]),[b]),{data:g}=x({queryKey:["apollo-status",t],queryFn:()=>p(`/apollo/status?workspace=${t}`,h.get),enabled:!!t,retry:!1,staleTime:6e4}),{data:j}=x({queryKey:["calendly-status",t],queryFn:()=>p(`/calendly/status?workspace=${t}`,h.get),enabled:!!t,retry:!1,staleTime:6e4}),{data:k}=x({queryKey:["heyreach-status",t],queryFn:()=>p(`/heyreach/status?workspace=${t}`,h.get),enabled:!!t,retry:!1,staleTime:6e4}),{connectedByKey:m,countByKey:I}=u.useMemo(()=>{const s={},n={},o=l=>f.find(d=>d.provider===l);["hubspot","salesforce","pipedrive","zoho","close"].forEach(l=>{const d=o(l);s[l]=!!d&&(d.status==="connected"||d.status==="syncing")});const v=l=>y.filter(d=>d.source===l&&d.isActive!==!1).length;return["slack","discord","teams"].forEach(l=>{n[l]=v(l),s[l]=n[l]>0}),n.webhooks=v("custom"),s.webhooks=n.webhooks>0,s.apollo=!!g?.connected,s.calendly=!!j?.connected,s.heyreach=!!k?.connected,{connectedByKey:s,countByKey:n}}
1,[f,y,g,j,k]),N=Object.values(m).filter(Boolean).length,w=u.useMemo(()=>{const s=a.trim().toLowerCase();return s?C.filter(n=>n.name.toLowerCase().includes(s)||n.short.toLowerCase().includes(s)):C},[a]);return e.jsxs(E,{className:"font-poppins",children:[e.jsx(A,{title:"Integrations",subtitle:N>0?`Connect PrimaryHub to your stack — ${N} connected`:"Connect PrimaryHub to your CRM, chat, automation tools and more.",actions:e.jsxs("div",{className:"relative w-full sm:w-72",children:[e.jsx(P,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-secondary"}),e.jsx("input",{value:a,onChange:s=>c(s.target.value),placeholder:"Search integrations",className:"h-10 w-full rounded-lg border border-border bg-surface pl-9 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:border-custom-blue focus:outline-none"})]})}),e.jsxs("div",{className:"space-y-9 pb-10",children:[R.map(s=>{const n=w.filter(o=>o.category===s.key);return n.length===0?null:e.jsxs("section",{children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("h2",{className:"text-base font-semibold text-text-primary",children:s.label}),e.jsx("p",{className:"text-[12.5px] text-text-secondary",children:s.blurb})]}),e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:n.map(o=>e.jsx(H,{integration:o,connected:m[o.key],count:I[o.key]||0,comingSoon:o.auth==="oauth"&&!m[o.key]&&S?.[o.key]===!1,onOpen:()=>r(o.to)},o.key))})]},s.key)}),w.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-dashed border-border py-16 text-center",children:[e.jsxs("p",{className:"text-sm font-medium text-text-primary",children:["No integrations match “",a,"”."]}),e.jsx("p",{className:"mt-1 text-xs text-text-secondary",children:"Try a different search, or request one — webhooks & the REST API connect to almost anything."})]})]})]})};export{Z 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.