1import{j as e,H as m,L as x}from"./app-Lg2tb55k.js";function o({value:t,max:l=5}){const r=Math.round(t/l*100),a=r>=80?"bg-green-500":r>=60?"bg-accent":r>=40?"bg-amber-500":"bg-red-500";return e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-border",children:e.jsx("div",{className:`h-full rounded-full ${a}`,style:{width:`${r}%`}})})}function i(t){return t==="A"?"bg-green-500/10 text-green-400":t==="B"?"bg-accent/10 text-accent":t==="C"?"bg-amber-500/10 text-amber-400":"bg-red-500/10 text-red-400"}function c(t){return new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR",maximumFractionDigits:0}).format(t)}function p({scan:t,history:l}){const r=t.enrichedCompany||t.enrichedSiret||t.enrichedEmails&&t.enrichedEmails.length>0||t.enrichedPhones&&t.enrichedPhones.length>0||t.enrichedAddress,a=new URLSearchParams({company:t.companyName,email:t.email,siteUrl:t.siteUrl}).toString();return e.jsxs(e.Fragment,{children:[e.jsx(m,{title:`Scan â ${t.companyName}`}),e.jsxs("div",{className:"mb-6",children:[e.jsx(x,{href:"/admin/scans",className:"mb-4 inline-flex items-center gap-1 text-sm text-text-muted hover:text-text",children:"â Retour aux scans"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("h1",{className:"text-2xl font-bold text-text",children:t.companyName}),e.jsx("span",{className:`inline-flex rounded-full px-2.5 py-0.5 text-xs font-semibold ${i(t.grade)}`,children:t.grade}),e.jsx("a",{href:t.siteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent hover:underline",children:t.siteUrl})]})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"space-y-6 lg:col-span-2",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-bg-surface p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold uppercase tracking-wider text-text-muted",children:"Score global"}),e.jsxs("div",{className:"flex items-center gap-8",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-5xl font-bold text-text",children:[t.scoreTotal,e.jsx("span",{className:"text-2xl font-normal text-text-muted",children:"/30"})]}),e.jsx("span",{className:`mt-2 inline-flex rounded-full px-3 py-1 text-sm font-semibold ${i(t.grade)}`,children:t.grade})]}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"Perte estimée"}),e.jsxs("p",{className:"mt-0.5 text-xl font-semibold text-red-400",children:[c(t.perteEstimee)," / mois"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"Budget estimé pour corriger"}),e.jsx("p",{className:"mt-0.5 text-sm text-text-secondary",children:c(t.budgetEstimate)})]})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-bg-surface p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold uppercase tracking-wider text-text-muted",children:"Détail par catégorie"}),e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:t.categories.map(s=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm font-medium text-text",children:s.label}),e.jsxs("span",{className:"text-xs font-semibold text-text-muted",children:[s.score,"/",s.maxScore]})]}),e.jsx(o,{value:s.score,max:s.maxScore}),s.details.length>0&&e.jsx("ul",{className:"space-y-0.5",children:s.details.map((d,n)=>e.jsxs("li",{className:"text-xs text-text-muted",children:["· ",d]},n))})]},s.name))})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-bg-surface p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold uppercase tracking-wider text-text-muted",children:"Technologies détectées"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.tags.map(s=>e.jsx("span",{className:`inline-flex rounded-full px-2.5 py-0.5 text-xs font-medium ${s.detected?"bg-green-500/10 text-green-400":"bg-border text-text-muted"}`,children:s.name},s.id??s.name))})]}),t.hasServerSide&&t.serverSideProvider&&e.jsx("div",{className:"rounded-lg border border-accent/20 bg-accent/5 p-4",children:e.jsxs("p",{className:"text-sm text-accent",children:[e.jsx("span",{className:"font-semibold",children:"Tracking server-side :"})," ",t.serverSideProvider]})})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-bg-surface p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold uppercase tracking-wider text-text-muted",children:"Données enrichies"}),r?e.jsxs("div",{className:"space-y-3",children:[t.enrichedCompany&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"Raison sociale"}),e.jsx("p",{className:"mt-0.5 text-sm text-text-secondary",children:t.enrichedCompany})]}),t.enrichedSiret&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"SIRET"}),e.jsx("p",{className:"mt-0.5 font-mono text-sm text-text-secondary",children:t.enrichedSiret})]}),t.enrichedEmails&&t.enrichedEmails.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"Emails"}),e.jsx("div",{className:"mt-0.5 space-y-0.5",children:t.enrichedEmails.map(s=>e.jsx("a",{href:`mailto:${s}`,className:"block text-sm text-accent hover:underline",children:s},s))})]}),t.enrichedPhones&&t.enrichedPhones.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"Téléphones"}),e.jsx("div",{className:"mt-0.5 space-y-0.5",children:t.enrichedPhones.map(s=>e.jsx("a",{href:`tel:${s}`,className:"block text-sm text-accent hover:underline",children:s},s))})]}),t.enrichedAddress&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"Adresse"}),e.jsx("p",{className:"mt-0.5 text-sm text-text-secondary",children:t.enrichedAddress})]})]}):e.jsx("p",{className:"text-sm text-text-muted",children:"Données non disponibles"})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-bg-surface p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold uppercase tracking-wider text-text-muted",children:"Informations scan"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"Email"}),e.jsx("p",{className:"mt-0.5 text-sm text-text-secondary",children:t.email})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"Budget déclaré"}),e.jsx("p",{className:"mt-0.5 text-sm text-text-secondary",children:t.budgetRange})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"CMS détecté"}),e.jsx("p",{className:"mt-0.5 text-sm text-text-secondary",children:t.cmsDetected??"â"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"CMP détectée"}),e.jsx("p",{className:"mt-0.5 text-sm text-text-secondary",children:t.cmpDetected??"â"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"PageSpeed Mobile"}),e.jsx("p",{className:"mt-0.5 text-sm text-text-secondary",children:t.pagespeedMobile!==null?`${t.pagespeedMobile}/100`:"â"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"PageSpeed Desktop"}),e.jsx("p",{className:"mt-0.5 text-sm text-text-secondary",children:t.pagespeedDesktop!==null?`${t.pagespeedDesktop}/100`:"â"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text-muted",children:"Date du scan"}),e.jsx("p",{className:"mt-0.5 text-sm text-text-secondary",children:new Date(t.createdAt).toLocaleDateString("fr-FR")})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-bg-surface p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold uppercase tracking-wider text-text-muted",children:"Actions"}),e.jsxs("div",{className:"space-y-2",children:[t.leadId?e.jsx(x,{href:`/admin/leads/${t.leadId}`,className:"flex w-full items-center justify-center gap-2 rounded-lg bg-accent px-4 py-2.5 text-sm font-medium text-white hover:bg-accent-hover",children:"Voir le lead"}):e.jsx(x,{href:`/admin/leads/new?${a}`,className:"flex w-full items-center justify-center gap-2 rounded-lg bg-accent px-4 py-2.5 text-sm font-medium text-white hover:bg-accent-hover",children:"Créer un lead"}),e.jsx("a",{href:t.siteUrl,target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center justify-center gap-2 rounded-lg border border-border px-4 py-2.5 text-sm text-text-secondary hover:bg-bg-hover",children:"Ouvrir le site"})]})]})]})]}),e.jsxs("div",{className:"mt-6 rounded-xl border border-border bg-bg-surface p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold uppercase tracking-wider text-text-muted",children:"Historique des scans"}),l.length<=1?e.jsx("p",{className:"py-4 text-center text-sm text-text-muted",children:"Premier scan de ce site"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"pb-3 text-left text-xs font-semibold uppercase tracking-wider text-text-muted",children:"Date"}),e.jsx("th",{className:"pb-3 text-left text-xs font-semibold uppercase tracking-wider text-text-muted",children:"Score"}),e.jsx("th",{className:"pb-3 text-left text-xs font-semibold uppercase tracking-wider text-text-muted",children:"Grade"}),e.jsx("th",{className:"pb-3 text-left text-xs font-semibold uppercase tracking-wider text-text-muted",children:"Perte estimée"})]})}),e.jsx("tbody",{className:"divide-y divide-border",children:l.map(s=>{const d=s.id===t.id;return e.jsxs("tr",{className:d?"bg-accent/5":"hover:bg-bg-elevated",children:[e.jsx("td",{className:"py-3",children:e.jsxs(x,{href:`/admin/scans/${s.id}`,className:`hover:underline ${d?"font-semibold text-accent":"text-text-secondary"}`,children:[new Date(s.createdAt).toLocaleDateString("fr-FR"),d&&e.jsx("span",{className:"ml-2 text-xs font-normal text-text-muted",children:"(actuel)"})]})}),e.jsxs("td",{className:"py-3 text-text-secondary",children:[s.scoreTotal,"/30"]}),e.jsx("td",{className:"py-3",children:e.jsx("span",{className:`inline-flex rounded-full px-2 py-0.5 text-xs font-semibold ${i(s.grade)}`,children:s.grade})}),e.jsxs("td",{className:"py-3 text-text-secondary",children:[c(s.perteEstimee)," / mois"]})]},s.id)})})]})})]})]})}export{p 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.