PageSourceSearch

https://nichall.co.uk/assets/CompanyDocuments-CLugON8-.js

js nichall.co.uk collected 2026-10-06 20:31:44 UTC 24,046 bytes, 2 lines download raw bytes

1import{j as e}from"./vendor-radix-Cshc0K_j.js";import{r as l}from"./vendor-react-CfDhItdx.js";import{S as Fe}from"./SettingsPageWrapper-BomFdC5S.js";import{A as Oe,a as Ue,b as Le,c as Ve,d as Re,e as Me,f as Be,g as qe}from"./alert-dialog-pVEpA8iY.js";import{g as p,i as ee,bi as ae,L as k,C as g,c as j,b8 as Q,j as d,aR as Qe,b2 as ze,b3 as K,aS as X,q as Y,B as We,S as ue,bb as $e,bc as Ge,aH as He,b9 as xe,b6 as _,d as Ke,f as Xe,aE as Ye,az as Ze,t as Je,aq as es,Q as R,T as M,U as B,V as q,W as Z,Y as u,a0 as J,Z as x,ap as ss}from"./index-y9XPgVzP.js";import{S as as,a as ts,b as ns,c as rs,d as ls}from"./select-BJfkvRaZ.js";import{T as is}from"./textarea-1B7nmw2F.js";import"./index-wLBhUoFB.js";import{I as cs}from"./InsuranceDetailsWalkthrough-HhfWZh6t.js";import{r as ce,I as de,s as oe,m as ds}from"./insuranceDetailsSteps-d3LIEcN3.js";import{b as os,a as ms}from"./useCompanyDocuments-DWa_A6X6.js";import{u as us}from"./useInsuranceQuoteRequest-Dd0rv-lQ.js";import{d as xs,f as se}from"./vendor-date-DbbbO-EH.js";import{T as he}from"./triangle-alert-BfBxJsqE.js";import{C as te}from"./circle-x-DVA3SzXz.js";import{U as pe}from"./upload-Bz6JZyfA.js";import{P as ge}from"./pound-sterling-DGC1geTb.js";import{C as hs}from"./calendar-BImnbmrI.js";import{T as ps}from"./trash-2-pPJcG1aT.js";import{W as ne}from"./wrench-gvzNNweX.js";import{B as je}from"./briefcase-CXn8tVrB.js";import"./settings-Bmm9B9Uo.js";import"./SectionPageHeader-CNvFVFlN.js";import"./vendor-query-CjzA0R3G.js";import"./vendor-supabase-cPZYlnRj.js";import"./vendor-charts-DiRvbK1V.js";import"./vendor-forms-Cpwam5X-.js";import"./shield-check-DYG7We3h.js";import"./file-check-B1fKFs_T.js";import"./queryKeys-DXnMyrEj.js";import"./pdfToImage-B8BZKv9l.js";function fe({doc:s,getDocumentStatus:i}){const r=i(s),o=s.expiry_date?xs(new Date(s.expiry_date),new Date):null;switch(r){case"expired":return e.jsxs(p,{variant:"destructive",className:"gap-1",children:[e.jsx(te,{className:"h-3 w-3"}),"Expired"]});case"expiring-soon":return e.jsxs(p,{variant:"destructive",className:"gap-1 bg-amber-500 hover:bg-amber-600",children:[e.jsx(he,{className:"h-3 w-3"}),"Expires in ",o," days"]});case"expiring":return e.jsxs(p,{variant:"secondary",className:"gap-1 bg-amber-100 text-amber-800 hover:bg-amber-200",children:[e.jsx(ee,{className:"h-3 w-3"}),"Expires in ",o," days"]});case"valid":return e.jsxs(p,{variant:"secondary",className:"gap-1 bg-green-100 text-green-800 hover:bg-green-200",children:[e.jsx(ae,{className:"h-3 w-3"}),"Valid"]});default:return e.jsxs(p,{variant:"outline",className:"gap-1",children:[e.jsx(ee,{className:"h-3 w-3"}),"Unknown"]})}}function ve({verificationStatus:s}){switch(s){case"verified":return e.jsxs(p,{className:"gap-1 bg-blue-600 hover:bg-blue-700",children:[e.jsx(ae,{className:"h-3 w-3"}),"Verified"]});case"rejected":return e.jsxs(p,{variant:"destructive",className:"gap-1",children:[e.jsx(te,{className:"h-3 w-3"}),"Rejected"]});default:return e.jsxs(p,{variant:"outline",className:"gap-1",children:[e.jsx(ee,{className:"h-3 w-3"}),"Pending Review"]})}}const gs={Shield:_,Users:xe,Briefcase:je,Wrench:ne,FileText:Q};function js(s){return(s?gs[s]:_)||_}function fs({doc:s,onView:i,onEdit:r,onDelete:o,onReExtract:C,isReExtracting:f,getDocumentStatus:D}){var N,y;const v=js(((N=s.insurance_type)==null?void 0:N.icon)||null),h=D(s);return e.jsx(g,{className:Y("hover:shadow-md transition-shadow",h==="expired"&&"border-destructive/50 bg-destructive/5",h==="expiring-soon"&&"border-amber-500/50 bg-amber-50"),children:e.jsxs(j,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx("div",{className:Y("w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0",s.verification_status==="verified"?"bg-blue-100":"bg-muted"),children:e.jsx(v,{className:Y("h-5 w-5",s.verification_status==="verified"?"text-blue-600":"text-muted-foreground")})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-semibold text-foreground truncate",children:((y=s.insurance_type)==null?void 0:y.name)||s.document_type}),s.insurer_name&&e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1 mt-1",children:[e.jsx(We,{className:"h-3 w-3"}),s.insurer_name]}),s.coverage_amount&&e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[e.jsx(ge,{className:"h-3 w-3"}
1),"£",s.coverage_amount.toLocaleString()," coverage"]}),s.expiry_date&&e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[e.jsx(hs,{className:"h-3 w-3"}),"Expires: ",se(new Date(s.expiry_date),"dd MMM yyyy")]})]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-2",children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsx(fe,{doc:s,getDocumentStatus:D}),e.jsx(ve,{verificationStatus:s.verification_status})]}),s.extraction_confidence&&e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(ue,{className:"h-3 w-3"}),Math.round(s.extraction_confidence*100),"% AI confidence"]})]})]}),e.jsxs("div",{className:"flex gap-2 mt-4 pt-4 border-t",children:[e.jsxs(d,{variant:"outline",size:"sm",onClick:()=>i(s),children:[e.jsx($e,{className:"h-4 w-4 mr-1"}),"View"]}),e.jsxs(d,{variant:"outline",size:"sm",onClick:()=>r(s),children:[e.jsx(Ge,{className:"h-4 w-4 mr-1"}),"Edit"]}),e.jsxs(d,{variant:"outline",size:"sm",onClick:()=>C(s),disabled:f,children:[f?e.jsx(k,{className:"h-4 w-4 mr-1 animate-spin"}):e.jsx(He,{className:"h-4 w-4 mr-1"}),"Re-extract"]}),e.jsxs(d,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>o(s),children:[e.jsx(ps,{className:"h-4 w-4 mr-1"}),"Delete"]})]})]})})}function vs({documents:s,validDocuments:i,expiringDocuments:r,expiredDocuments:o,isLoading:C,onView:f,onEdit:D,onDelete:v,onReExtract:h,onUploadClick:N,isReExtracting:y,getDocumentStatus:P}){if(C)return e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(k,{className:"h-8 w-8 animate-spin text-primary"})});if(s.length===0)return e.jsx(g,{className:"border-dashed",children:e.jsx(j,{className:"py-12",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-muted mx-auto mb-4 flex items-center justify-center",children:e.jsx(Q,{className:"h-8 w-8 text-muted-foreground"})}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No documents uploaded"}),e.jsx("p",{className:"text-muted-foreground mb-4 max-w-md mx-auto",children:"Upload your insurance certificates to display verification badges on your profile and build trust with potential customers."}),e.jsxs(d,{onClick:N,"data-walkthrough":"insurance-upload-button",children:[e.jsx(pe,{className:"h-4 w-4 mr-2"}),"Upload Your First Document"]})]})})});const b=F=>e.jsx(fs,{doc:F,onView:f,onEdit:D,onDelete:v,onReExtract:h,isReExtracting:y,getDocumentStatus:P},F.id);return e.jsxs(Qe,{defaultValue:"all",className:"space-y-4",children:[e.jsxs(ze,{children:[e.jsxs(K,{value:"all",children:["All (",s.length,")"]}),e.jsxs(K,{value:"valid",children:["Valid (",i.length,")"]}),e.jsxs(K,{value:"attention",children:["Needs Attention (",r.length+o.length,")"]})]}),e.jsx(X,{value:"all",className:"space-y-4",children:s.map(b)}),e.jsx(X,{value:"valid",className:"space-y-4",children:i.length===0?e.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No valid documents"}):i.map(b)}),e.jsx(X,{value:"attention",className:"space-y-4",children:[...o,...r].length===0?e.jsx("p",{className:"text-center text-muted-foreground py-8",children:"All documents are up to date!"}):[...o,...r].map(b)})]})}const Ns={Shield:_,Users:xe,Briefcase:je,Wrench:ne,FileText:Q};function ys(s){return(s?Ns[s]:_)||_}function bs({availableTypes:s,onTypeSelect:i}){return s.length===0?null:e.jsxs(g,{children:[e.jsxs(Ke,{children:[e.jsx(Xe,{className:"text-lg",children:"Add More Insurance"}),e.jsx(Ye,{children:"Upload additional insurance certificates to enhance your profile"})]}),e.jsx(j,{children:e.jsx("div",{className:"grid gap-2 md:grid-cols-2",children:s.map(r=>{const o=ys(r.icon);return e.jsxs(d,{variant:"outline",className:"justify-start h-auto py-3 px-4",onClick:()=>i(r.id),"data-walkthrough":"insurance-type-upload-option",children:[e.jsx(o,{className:"h-5 w-5 shrink-0 mr-3 text-muted-foreground"}),e.jsxs("div",{className:"text-left flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:r.name}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:r.description})]}),e.jsx(Ze,{className:"h-4 w-4 shrink-0 ml-2"})]},r.id)})})})]})}const me="https://dpkqpvbdxzhmirrdlfnd.supabase.co/storage/v1/object/public/logos/kingsbridge_new.png?v=2";function ea(){var ie;const{company:s}=Je(),{data:i=[]}=os(),{documents:r,validDocuments:o,expiringDocuments:C,expiredDocuments:f,isLoading:D,uploadDocument:v,updateDocument:h,deleteDocument:N,reExtractData:y,getDocumentStatus:P}=ms(s==null?void 0:s.id),{submitRequest:b}=us(),[F,O]=l.useState(!1),[Ne,U]=l.useState(!1),[ye,z]=l.useState(!1),[be,re]=l.useState(!1),[t,A]=l.useState(null),[L,W]=l.useState(""),[I,le]=l.useState(null),S=l.useRef(null),[we,$]=l.useState(()=>ce()),[_e,V]=l.useState(!1),[m,T]=l.useState({currentInsurer:"",currentPremium:"",phone:"",notes:""});l.useEffect(()=>{const a=()=>$(ce());return window.addEventListener(de,a),window.addEventListener("storage",a),()=>{window.removeEventListener(de,a),window.removeEventListener("storage",a)}},[]);const Ce=l.useCallback(()=>{oe(!1),$(!1),s!=null&&s.id&&ds(s.id)},[s==null?void 0:s.id]),De=l.useCallback(()=>{oe(!1),$(!1)},[]),[c,w]=l.useState({insurer_name:"",policy_number:"",coverage_amount:"",excess_amount:"",start_date:"",expiry_date:""});if(!s)return null;const Ie=a=>{var E;const n=(E=a.target.files)==null?void 0:E[0];n&&(le(n),O(!0)),S.current&&(S.current.value="")},Se=async()=>
1{if(!(!I||!L||!(s!=null&&s.id))){try{await v.mutateAsync({file:I,documentType:L,companyId:s.id})}catch{}O(!1),le(null),W("")}},ke=a=>{var n,E;A(a),w({insurer_name:a.insurer_name||"",policy_number:a.policy_number||"",coverage_amount:((n=a.coverage_amount)==null?void 0:n.toString())||"",excess_amount:((E=a.excess_amount)==null?void 0:E.toString())||"",start_date:a.start_date||"",expiry_date:a.expiry_date||""}),U(!0)},Ae=async()=>{t&&(await h.mutateAsync({documentId:t.id,data:{insurer_name:c.insurer_name||null,policy_number:c.policy_number||null,coverage_amount:c.coverage_amount?parseFloat(c.coverage_amount):null,excess_amount:c.excess_amount?parseFloat(c.excess_amount):null,start_date:c.start_date||null,expiry_date:c.expiry_date||null}}),U(!1),A(null))},Te=async()=>{t&&(await N.mutateAsync(t.id),z(!1),A(null))},Ee=async a=>{await y.mutateAsync(a.id)},Pe=a=>{var n;W(a),(n=S.current)==null||n.click()},G=new Set(r.map(a=>a.document_type)),H=i.filter(a=>!G.has(a.id));return e.jsxs(e.Fragment,{children:[e.jsxs(Fe,{title:"Documents & Insurance",description:"Manage your insurance certificates and compliance documentation",headerAction:e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:S,type:"file",accept:".pdf,.jpg,.jpeg,.png,.webp,.docx,.doc",className:"hidden",onChange:Ie,"data-walkthrough":"insurance-file-input"}),e.jsxs(d,{onClick:()=>{var a;return(a=S.current)==null?void 0:a.click()},disabled:H.length===0,"data-walkthrough":"insurance-upload-button",children:[e.jsx(pe,{className:"h-4 w-4 mr-2"}),"Upload Document"]})]}),children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[e.jsx(g,{children:e.jsx(j,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-green-100 flex items-center justify-center",children:e.jsx(ae,{className:"h-5 w-5 text-green-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:o.length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Valid"})]})]})})}),e.jsx(g,{children:e.jsx(j,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-amber-100 flex items-center justify-center",children:e.jsx(he,{className:"h-5 w-5 text-amber-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:C.length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Expiring Soon"})]})]})})}),e.jsx(g,{children:e.jsx(j,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-red-100 flex items-center justify-center",children:e.jsx(te,{className:"h-5 w-5 text-red-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:f.length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Expired"})]})]})})}),e.jsx(g,{children:e.jsx(j,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-100 flex items-center justify-center",children:e.jsx(_,{className:"h-5 w-5 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:r.filter(a=>a.verification_status==="verified").length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Verified"})]})]})})})]}),e.jsx(g,{className:"bg-gradient-to-r from-slate-900 to-slate-800 text-white border-0 overflow-hidden",children:e.jsx(j,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[e.jsx("div",{className:"flex-shrink-0 bg-slate-800/50 rounded-lg p-3",children:e.jsx("img",{src:me,alt:"Kingsbridge Insurance",className:"h-8 w-auto max-w-[180px] object-contain"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-lg font-bold mb-1",children:"Let Us Beat Your Insurance Quote"}),e.jsx("p",{className:"text-slate-400 text-sm mb-2",children:"We've partnered with Kingsbridge to get you the best deal on trade insurance."}),e.jsxs("p",{className:"text-emerald-400 text-sm font-medium flex items-center gap-1.5",children:[e.jsx(ne,{className:"h-4 w-4 flex-shrink-0"}),"Plus get ","£","2,500 of tool cover included at no extra cost"]})]}),e.jsx("div",{className:"flex-shrink-0 w-full sm:w-auto",children:e.jsxs(d,{onClick:()=>V(!0),className:"bg-emerald-500 hover:bg-emerald-600 text-white font-semibold w-full sm:w-auto",children:["Get a Quote",e.jsx(es,{className:"ml-2 h-4 w-4"})]})})]})})}),e.jsx(vs,{documents:r,validDocuments:o,expiringDocuments:C,expiredDocuments:f,isLoading:D,onView:a=>{A(a),re(!0)},onEdit:ke,onDelete:a=>{A(a),z(!0)},onReExtract:Ee,onUploadClick:()=>{var a;return(a=S.current)==null?void 0:a.click()},isReExtracting:y.isPending,getDocumentStatus:P}),H.length>0&&r.length>0&&e.jsx(bs,{availableTypes:H,onTypeSelect:Pe}),e.jsx(R,{open:F,onOpenChange:O,children:e.jsxs(M,{"data-walkthrough":"insurance-upload-dialog",children:[e.jsxs(B,{children:[e.jsx(q,{children:"Upload Insurance Document"}),e.jsx(Z,{children:"Select the type of insurance and upload your certificate. Our AI will automatically extract the key details."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[I&&e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted rounded-lg min-w-0 overflow-hidden",children:[e.jsx(Q,{className:"h-8 w-8 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[e.jsx("p",{className:"font-medium truncate max-w-full",title:I.name,children:I.name}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[(I.size/1024/1024).toFixed(2)," MB"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{children:"Insurance Type"}),e.jsxs(as,{value:L,onValueChange:W,children:[e.jsx(ts,{"data-walkthrough":"insurance-type-selector",children:e.jsx(ns,{placeholder:"Select insurance type"})}),e.jsx(rs,{children:i.map(a=>e.jsxs(ls,{value:a.id,disabled:G.has(a.id),children:[a.name,G.has(a.id)&&" (already uploaded)"]},a.id))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Don't worry if you're unsure - our AI will try to detect the type automatically."})]})]}),e.jsxs(J,{children:[e.jsx(d,{variant:"outline",onClick:()=>O(!1),children:"Cancel"}),e.jsx(d,{onClick:Se,disabled:!L||v.isPending,"data-walkthrough":"insurance-upload-submit",children:v.isPending?e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"h-4 w-4 mr-2 animate-spin"}),"Uploading & Extracting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"h-4 w-4 mr-2"}
1),"Upload & Extract"]})})]})]})}),e.jsx(R,{open:Ne,onOpenChange:U,children:e.jsxs(M,{className:"max-w-lg",children:[e.jsxs(B,{children:[e.jsx(q,{children:"Edit Document Details"}),e.jsx(Z,{children:"Verify and update the extracted information"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"insurer_name",children:"Insurer Name"}),e.jsx(x,{id:"insurer_name",value:c.insurer_name,onChange:a=>w(n=>({...n,insurer_name:a.target.value})),placeholder:"e.g., Hiscox, AXA"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"policy_number",children:"Policy Number"}),e.jsx(x,{id:"policy_number",value:c.policy_number,onChange:a=>w(n=>({...n,policy_number:a.target.value})),placeholder:"e.g., POL123456"})]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(u,{htmlFor:"coverage_amount",children:["Coverage Amount (","£",")"]}),e.jsx(x,{id:"coverage_amount",type:"number",value:c.coverage_amount,onChange:a=>w(n=>({...n,coverage_amount:a.target.value})),placeholder:"e.g., 1000000"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(u,{htmlFor:"excess_amount",children:["Excess Amount (","£",")"]}),e.jsx(x,{id:"excess_amount",type:"number",value:c.excess_amount,onChange:a=>w(n=>({...n,excess_amount:a.target.value})),placeholder:"e.g., 250"})]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"start_date",children:"Start Date"}),e.jsx(x,{id:"start_date",type:"date",value:c.start_date,onChange:a=>w(n=>({...n,start_date:a.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"expiry_date",children:"Expiry Date"}),e.jsx(x,{id:"expiry_date",type:"date",value:c.expiry_date,onChange:a=>w(n=>({...n,expiry_date:a.target.value}))})]})]})]}),e.jsxs(J,{children:[e.jsx(d,{variant:"outline",onClick:()=>U(!1),children:"Cancel"}),e.jsxs(d,{onClick:Ae,disabled:h.isPending,children:[h.isPending?e.jsx(k,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Save Changes"]})]})]})}),e.jsx(R,{open:be,onOpenChange:re,children:e.jsxs(M,{className:"max-w-3xl max-h-[90vh]",children:[e.jsx(B,{children:e.jsx(q,{children:((ie=t==null?void 0:t.insurance_type)==null?void 0:ie.name)||(t==null?void 0:t.document_type)})}),t&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border rounded-lg overflow-hidden bg-muted",children:t.document_url.endsWith(".pdf")?e.jsx("iframe",{src:t.document_url,className:"w-full h-96",title:"Document preview"}):e.jsx("img",{src:t.document_url,alt:"Document",className:"w-full max-h-96 object-contain"})}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Insurer"}),e.jsx("p",{className:"font-medium",children:t.insurer_name||"-"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Policy Number"}),e.jsx("p",{className:"font-medium",children:t.policy_number||"-"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Coverage"}),e.jsx("p",{className:"font-medium",children:t.coverage_amount?`£${t.coverage_amount.toLocaleString()}`:"-"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Excess"}),e.jsx("p",{className:"font-medium",children:t.excess_amount?`£${t.excess_amount.toLocaleString()}`:"-"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Valid From"}),e.jsx("p",{className:"font-medium",children:t.start_date?se(new Date(t.start_date),"dd MMM yyyy"):"-"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Expires"}),e.jsx("p",{className:"font-medium",children:t.expiry_date?se(new Date(t.expiry_date),"dd MMM yyyy"):"-"})]})]}),e.jsxs("div",{className:"flex gap-2 pt-4 border-t",children:[e.jsx(fe,{doc:t,getDocumentStatus:P}),e.jsx(ve,{verificationStatus:t.verification_status})]})]})]})}),e.jsx(Oe,{open:ye,onOpenChange:z,children:e.jsxs(Ue,{children:[e.jsxs(Le,{children:[e.jsx(Ve,{children:"Delete Document?"}),e.jsx(Re,{children:"This will permanently delete this insurance document. This action cannot be undone."})]}),e.jsxs(Me,{children:[e.jsx(Be,{children:"Cancel"}),e.jsxs(qe,{onClick:Te,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[N.isPending?e.jsx(k,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Delete"]})]})]})}),e.jsx(R,{open:_e,onOpenChange:V,children:e.jsxs(M,{className:"sm:max-w-md",children:[e.jsxs(B,{children:[e.jsx("div",{className:"flex items-center gap-3 mb-2",children:e.jsx("img",{src:me,alt:"Kingsbridge",className:"h-10 w-auto"})}),e.jsx(q,{children:"Get an Insurance Quote"}),e.jsxs(Z,{children:["Tell us about your current insurance and we'll try to beat your quote. Plus get"," ","£","2,500 of tool cover included at no extra cost."]})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"currentInsurer",children:"Current Insurer"}),e.jsx(x,{id:"currentInsurer",placeholder:"e.g., AXA, Aviva, Direct Line...",value:m.currentInsurer,onChange:a=>T({...m,currentInsurer:a.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"currentPremium",children:"Current Premium (optional)"}),e.jsxs("div",{className:"relative",children:[e.jsx(ge,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(x,{id:"currentPremium",placeholder:"e.g., 450",className:"pl-9",value:m.currentPremium,onChange:a=>T({...m,currentPremium:a.target.value})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Sharing this helps us beat your quote"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"phone",children:"Phone Number"}),e.jsxs("div",{className:"relative",children:[e.jsx(ss,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(x,{id:"phone",type:"tel",placeholder:"07xxx xxxxxx",className:"pl-9",value:m.phone,onChange:a=>T({...m,phone:a.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"notes",children:"Anything else? (optional)"}),e.jsx(is,{id:"notes",placeholder:"Best time to call, specific cover requirements...",value:m.notes,onChange:a=>T({...m,notes:a.target.value}),rows:3})]})]}),e.jsxs(J,{children:[e.jsx(d,{variant:"outline",onClick:()=>V(!1),children:"Cancel"}),e.jsxs(d,{onClick:async()=>{s&&(await b.mutateAsync({company_id:s.id,company_name:s.company_name,contact_name:s.company_name,email:s.email||"",phone:m.phone||s.phone||void 0,current_insurer:m.currentInsurer||void 0,current_premium:m.currentPremium||void 0,notes:m.notes||void 0}),V(!1),T({currentInsurer:"",currentPremium:"",phone:"",notes:""}))},disabled:b.isPending,className:"bg-emerald-500 hover:bg-emerald-600",children:[b.isPending?e.jsx(k,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Request Quote"]})]})]})})]}),e.jsx(cs,{isActive:we,companyId:s.id,onComplete:Ce,onSkip:De})]})}
1export{ea as default};
2//# sourceMappingURL=CompanyDocuments-CLugON8-.js.map

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.