PageSourceSearch

https://socialnex.ai/assets/staff.business-audit-BeX_5UOp.js

js socialnex.ai collected 2026-10-05 15:10:59 UTC 4,418 bytes, 1 lines download raw bytes

1import{j as e,r as s}from"./react-vendor-hAxFZxNQ.js";import{D as t,c as a,aj as n,f as r,aw as c,_ as i}from"./main-C-ofR5-x.js";import{S as l}from"./switch-DrPErZvU.js";import{T as m,a as o,b as d,c as x,d as u,e as h}from"./table-BGe0PlYY.js";import"./ui-DlHKYJvh.js";function j(e){return!e.has_website||!e.has_phone||!e.has_email||e.competitor_count<3}function f(){const[t,f]=s.useState([]),[b,g]=s.useState(!0),[N,v]=s.useState(""),[w,y]=s.useState(!1);s.useEffect(()=>{const e=setTimeout(()=>(async e=>{g(!0);try{const s=await c.getCompanyProfilesAudit(e||void 0);f(s.results)}catch(s){i({title:"Failed to load businesses",description:s instanceof Error?s.message:"Unknown error",variant:"destructive"})}finally{g(!1)}})(N),250);return()=>clearTimeout(e)},[N]);const _=s.useMemo(()=>w?t.filter(j):t,[t,w]),k=s.useMemo(()=>t.filter(j).length,[t]);return e.jsxs("div",{className:"p-6 md:p-10 max-w-[1280px] mx-auto",children:[e.jsx("div",{className:"mb-6 flex items-start justify-between gap-4",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Business Audit"}),e.jsxs("p",{className:"text-muted-foreground text-sm mt-1",children:["Every business across all teams. Read-only — edit a business from"," ",e.jsx("span",{className:"font-medium text-foreground",children:"Businesses"})," inside its own team, or via Django admin."]})]})}),e.jsxs("div",{className:"mb-6 flex flex-wrap items-center gap-4",children:[e.jsxs("div",{className:"relative max-w-sm flex-1 min-w-[220px]",children:[e.jsx(a,{name:"Search",className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(n,{placeholder:"Search by business name…",value:N,onChange:e=>v(e.target.value),className:"pl-9"})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer select-none",children:[e.jsx(l,{checked:w,onCheckedChange:y}),e.jsxs("span",{children:["Incomplete only",!b&&e.jsxs("span",{className:"text-muted-foreground",children:[" (",k,")"]})]})]})]}),b?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground py-12 justify-center",children:[e.jsx(a,{name:"LoaderCircle",className:"w-4 h-4 animate-spin"}),"Loading businesses…"]}):0===_.length?e.jsxs("div",{className:"text-center py-16 rounded-xl bg-muted/30 border border-dashed border-border",children:[e.jsx(a,{name:"Inbox",className:"w-12 h-12 text-muted-foreground/40 mx-auto mb-3"}),e.jsx("p",{className:"text-sm font-medium mb-1",children:N?"No businesses match that search":w?"Nothing incomplete — every business has full context":"No businesses yet"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:w&&!N?'Turn off "Incomplete only" to see the full list.':"Try a different name."})]}):e.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:e.jsxs(m,{children:[e.jsx(o,{children:e.jsxs(d,{className:"bg-muted/40 hover:bg-muted/40",children:[e.jsx(x,{children:"Business"}),e.jsx(x,{children:"Team"}),e.jsx(x,{className:"text-center",children:"Accounts"}),e.jsx(x,{className:"text-center",children:"Website"}),e.jsx(x,{className:"text-center",children:"Phone"}),e.jsx(x,{className:"text-center",children:"Email"}),e.jsx(x,{className:"text-center",children:"Competitors"})]})}),e.jsx(u,{children:_.map(s=>e.jsxs(d,{className:r(j(s)&&"bg-amber-50/50 dark:bg-amber-950/10"),children:[e.jsx(h,{className:"font-medium",children:s.name}),e.jsx(h,{className:"text-muted-foreground",children:s.team_name}),e.jsx(h,{className:"text-center",children:s.linked_account_count}),e.jsx(h,{className:"text-center",children:e.jsx(p,{present:s.has_website})}),e.jsx(h,{className:"text-center",children:e.jsx(p,{present:s.has_phone})}),e.jsx(h,{className:"text-center",children:e.jsx(p,{present:s.has_email})}),e.jsx(h,{className:"text-center",children:e.jsxs("span",{className:r("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",s.competitor_count>=3?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300":"bg-muted text-muted-foreground"),children:[s.competitor_count,"/",3]})})]},s.id))})]})})]})}function p({present:s}){return s?e.jsx(a,{name:"Check",className:"w-4 h-4 text-green-600 dark:text-green-400 inline-block"}
1):e.jsx(a,{name:"X",className:"w-4 h-4 text-muted-foreground/50 inline-block"})}const b=function(){return e.jsx(t,{children:e.jsx(f,{})})};export{b 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.