PageSourceSearch

https://fh-os.lovable.app/assets/EmployerProspectDetail-CsnaGs0w.js

js fh-os.lovable.app collected 2026-10-03 03:31:26 UTC 7,979 bytes, 1 lines download raw bytes

1import{j as e}from"./ui-Bfxz8aEs.js";import{h as T,f as A,r as v,L as z}from"./vendor-B1fWbc4m.js";import{S as R,an as V,o as p,ao as O,am as H,B as M,g as f,i as _,j as y,h as N,L as i,af as r,x as b,y as w,z as k,E as C,F as c,aa as S,Q as U}from"./index-dy_MsEBA.js";import{T as Q}from"./textarea-BcpY4LR0.js";import{S as Y}from"./slider-Dp9zBjko.js";import{c as q,b as J,d as K,e as W,E}from"./useEmployerProspects-rj6bUn-G.js";import{F as P}from"./_shell-DdzS5A82.js";import{S as X}from"./save-OJEKMKPX.js";import"./supabase-DAkTXe5u.js";function le(){var u,j,g;const{id:d}=T(),L=A(),{data:o,isLoading:D}=q(d),m=J(),x=K(),B=W(),[a,h]=v.useState(null);if(v.useEffect(()=>{o&&h(o)},[o]),D||!a)return e.jsx(P,{children:e.jsx("div",{className:"max-w-5xl mx-auto p-6",children:e.jsx(R,{className:"h-96 w-full"})})});const n=a.ai_brief;function t(s,l){h(G=>({...G,[s]:l}))}async function F(){await m.mutateAsync(a)}async function I(){confirm("Delete this prospect?")&&(await B.mutateAsync(d),L("/fps/employer-strategy"))}return e.jsx(P,{children:e.jsxs("div",{className:"max-w-5xl mx-auto p-4 md:p-6 space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(z,{to:"/fps/employer-strategy",className:"inline-flex items-center text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(V,{className:"h-4 w-4 mr-1"})," Back to pipeline"]}),e.jsxs(p,{variant:"ghost",size:"sm",onClick:I,className:"text-destructive hover:text-destructive",children:[e.jsx(O,{className:"h-4 w-4 mr-1"})," Delete"]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(H,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wider text-muted-foreground",children:"Employer Prospect"}),e.jsx("h1",{className:"text-2xl font-bold",children:a.company_name})]}),e.jsx(M,{variant:"outline",className:"capitalize",children:(u=E.find(s=>s.key===a.pipeline_stage))==null?void 0:u.label})]}),e.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(f,{children:[e.jsx(_,{children:e.jsx(y,{className:"text-base",children:"Company profile"})}),e.jsxs(N,{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(i,{children:"Company name"}),e.jsx(r,{value:a.company_name??"",onChange:s=>t("company_name",s.target.value)})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Industry"}),e.jsx(r,{value:a.industry??"",onChange:s=>t("industry",s.target.value)})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Employee count"}),e.jsx(r,{type:"number",value:a.employee_count??"",onChange:s=>t("employee_count",s.target.value?parseInt(s.target.value):null)})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Estimated contract value"}),e.jsx(r,{type:"number",value:a.estimated_contract_value??0,onChange:s=>t("estimated_contract_value",parseFloat(s.target.value)||0)})]}),e.jsxs("div",{children:[e.jsx(i,{children:"City"}),e.jsx(r,{value:a.location_city??"",onChange:s=>t("location_city",s.target.value)})]}),e.jsxs("div",{children:[e.jsx(i,{children:"State"}),e.jsx(r,{value:a.location_state??"",onChange:s=>t("location_state",s.target.value)})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Self-funded likelihood"}),e.jsxs(b,{value:a.self_funded_likelihood,onValueChange:s=>t("self_funded_likelihood",s),children:[e.jsx(w,{children:e.jsx(k,{})}),e.jsxs(C,{children:[e.jsx(c,{value:"unknown",children:"Unknown"}),e.jsx(c,{value:"low",children:"Low"}),e.jsx(c,{value:"medium",children:"Medium"}),e.jsx(c,{value:"high",children:"High"})]})]})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Renewal timing"}),e.jsx(r,{type:"date",value:a.renewal_timing??"",onChange:s=>t("renewal_timing",s.target.value||null)})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Decision maker"}),e.jsx(r,{value:a.decision_maker??"",onChange:s=>t("decision_maker",s.target.value)})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Decision maker email"}),e.jsx(r,{value:a.decision_maker_email??"",onChange:s=>t("decision_maker_email",s.target.value)})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx(i,{children:"Broker relationship"}),e.jsx(r,{value:a.broker_relationship??"",onChange:s=>t("broker_relationship",s.target.value)})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs(i,{children:["Strategic fit score: ",a.strategic_fit_score]}),e.jsx(Y,{value:[a.strategic_fit_score],max:100,step:1,onValueChange:s=>t("strategic_fit_score",s[0]),className:"mt-2"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx(i,{children:"Pipeline stage"}),e.jsxs(b,{value:a.pipeline_stage,onValueChange:s=>t("pipeline_stage",s),children:[e.jsx(w,{children:e.jsx(k,{})}),e.jsx(C,{children:E.map(s=>e.jsx(c,{value:s.key,children:s.label},s.key))})]})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx(i,{children:"Next action"}),e.jsx(r,{value:a.next_action??"",onChange:s=>t("next_action",s.target.value)})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx(i,{children:"Notes"}),e.jsx(Q,{value:a.notes??"",onChange:s=>t("notes",s.target.value),rows:4})]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(p,{onClick:F,disabled:m.isPending,children:[e.jsx(X,{className:"h-4 w-4 mr-2"}),m.isPending?"Saving…":"Save changes"]})})]}),e.jsx("div",{className:"space-y-6",children:e.jsxs(f,{className:"border-primary/20",children:[e.jsx(_,{children:e.jsxs(y,{className:"text-base flex items-center gap-2",children:[e.jsx(S,{className:"h-4 w-4 text-primary"}),"Employer Brief"]})}),e.jsxs(N,{className:"space-y-3",children:[n?e.jsxs("div",{className:"space-y-4 text-sm",children:[n.fit_summary&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wider text-muted-foreground font-semibold mb-1",children:"Fit summary"}),e.jsx("p",{children:n.fit_summary})]}),((j=n.pain_points)==null?void 0:j.length)>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wider text-muted-foreground font-semibold mb-1",children:"Pain points"}),e.jsx("ul",{className:"list-disc pl-4 space-y-0.5",children:n.pain_points.map((s,l)=>e.jsx("li",{children:s},l))})]}),n.dpc_angle&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wider text-muted-foreground font-semibold mb-1",children:"DPC angle"}),e.jsx("p",{children:n.dpc_angle})]}),n.outreach_message&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wider text-muted-foreground font-semibold mb-1",children:"Outreach message"}),e.jsx("p",{className:"whitespace-pre-wrap rounded-md bg-muted/50 p-2 text-xs",children:n.outreach_message})]}),((g=n.objections)==null?void 0:g.length)>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wider text-muted-foreground font-semibold mb-1",children:"Objections"}),e.jsx("div",{className:"space-y-2",children:n.objections.map((s,l)=>e.jsxs("div",{className:"text-xs rounded-md border border-border/50 p-2",children:[e.jsx("p",{className:"font-semibold",children:s.objection}),e.jsx("p",{className:"text-muted-foreground mt-1",children:s.response})]},l))})]})]}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Generate an AI-powered strategic brief: fit, pain points, DPC angle, outreach message, and likely objections."}),e.jsx(p,{onClick:()=>x.mutate(d),disabled:x.isPending,variant:n?"outline":"default",size:"sm",className:"w-full",children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"h-4 w-4 mr-2 animate-spin"}),"Generating…"]}):e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"h-4 w-4 mr-2"}),n?"Regenerate brief":"Generate brief"]})}),a.ai_brief_generated_at&&e.jsxs("p",{className:"text-[10px] text-muted-foreground text-center",children:["Generated ",new Date(a.ai_brief_generated_at).toLocaleStr
1ing()]})]})]})})]})]})})}export{le 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.