PageSourceSearch

https://younghollywood.com/assets/admin.ai-performance-DujukQZz.js

js younghollywood.com collected 2026-09-24 21:06:59 UTC 5,312 bytes, 1 lines download raw bytes

1import{Q as N,U as y,X as v,Y as w,r as n,j as e}from"./index-BZbnK03S.js";const A=N({method:"POST"}).middleware([y]).handler(v("8530c6364164f32fb9452a53d024c0157c0054e91213945a505761ab1156f201"));function c(a){return Math.round(a).toLocaleString("en-US")}function d(a){return`${(a*100).toFixed(2)}%`}function x({label:a,value:t,sub:o,tone:l="neutral"}){const h=l==="good"?"text-emerald-600":l==="bad"?"text-red-600":"text-foreground";return e.jsxs("div",{className:"border border-border bg-card p-4",children:[e.jsx("p",{className:"yh-eyebrow text-[11px] text-muted-foreground",children:a}),e.jsx("p",{className:`yh-headline text-2xl mt-1 ${h}`,children:t}),o&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:o})]})}function S(){const a=w(A),[t,o]=n.useState(null),[l,h]=n.useState(null),[m,f]=n.useState("all");n.useEffect(()=>{a().then(o).catch(s=>h(String(s?.message??s)))},[]);const j=n.useMemo(()=>{if(!t)return[];switch(m){case"ai":return t.rows.filter(s=>s.isAi);case"editorial":return t.rows.filter(s=>!s.isAi);case"flagged":return t.rows.filter(s=>s.isAi&&s.notIndexed);default:return t.rows}},[t,m]);if(l)return e.jsx("p",{className:"text-red-600",children:l});if(!t)return e.jsx("p",{className:"text-muted-foreground",children:"Loading…"});if(!t.snapshotDate)return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"yh-headline text-2xl",children:"AI content performance"}),e.jsx("p",{className:"text-muted-foreground",children:"No snapshot yet. The weekly job runs Mondays 6am PT and backfills the last 60 days of articles from Search Console."})]});const{ai:r,editorial:i}=t.summary,b=r.indexable?r.indexed/r.indexable:0,p=i.indexable?i.indexed/i.indexable:0,u=t.rows.filter(s=>s.isAi&&s.notIndexed).length,g=t.rows.filter(s=>s.isAi&&s.clicks>0).slice(0,5);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"yh-headline text-2xl",children:"AI content performance"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Search Console snapshot ",t.snapshotDate," · trailing 28 days · articles published in the last 60 days · refreshes Mondays 6am PT"]})]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[e.jsx(x,{label:"AI stories indexed",value:`${r.indexed}/${r.indexable}`,sub:`${d(b)} of AI stories 7+ days old earned impressions · editorial ${d(p)}`,tone:b>=p*.8?"good":"bad"}),e.jsx(x,{label:"AI clicks (28d)",value:c(r.clicks),sub:`${r.stories} stories in window`}),e.jsx(x,{label:"AI CTR vs editorial",value:d(r.ctr),sub:`editorial ${d(i.ctr)}`,tone:r.ctr>=i.ctr*.8?"neutral":"bad"}),e.jsx(x,{label:"Not indexed (14d+)",value:String(u),sub:"AI stories with zero impressions after 14 days",tone:u>0?"bad":"good"})]}),g.length>0&&e.jsxs("div",{className:"border border-border bg-card",children:[e.jsx("div",{className:"p-3 border-b border-border yh-eyebrow text-xs",children:"Top AI winners"}),e.jsx("ul",{className:"divide-y divide-border/60",children:g.map(s=>e.jsxs("li",{className:"p-3 flex items-baseline justify-between gap-4",children:[e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer",className:"text-sm hover:underline",children:s.title}),e.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground whitespace-nowrap",children:[c(s.clicks)," clicks · ",d(s.ctr)]})]},s.articleId))})]}),e.jsx("div",{className:"flex gap-2",children:["all","ai","editorial","flagged"].map(s=>e.jsx("button",{onClick:()=>f(s),className:`px-3 py-1 text-xs yh-eyebrow border ${m===s?"bg-foreground text-background border-foreground":"border-border text-muted-foreground"}`,children:s==="flagged"?`Not indexed (${u})`:s},s))}),e.jsx("div",{className:"border border-border bg-card overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"text-[11px] yh-eyebrow text-muted-foreground",children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left p-2",children:"Story"}),e.jsx("th",{className:"text-left p-2",children:"Type"}),e.jsx("th",{className:"text-right p-2",children:"Days live"}),e.jsx("th",{className:"text-right p-2",children:"Clicks"}),e.jsx("th",{className:"text-right p-2",children:"Impressions"}),e.jsx("th",{className:"text-right p-2",children:"CTR"}),e.jsx("th",{className:"text-right p-2",children:"Avg pos"})]})}),e.jsx("tbody",{children:j.map(s=>e.jsxs("tr",{className:`border-b border-border/60 last:border-0 ${s.notIndexed?"bg-red-50 dark:bg-red-950/20":""}`,children:[e.jsx("td",{className:"p-2 max-w-md",children:e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer",className:"hover:underline line-clamp-1",children:s.title})}),e.jsx("td",{className:"p-2 text-xs text-muted-foreground",children:s.isAi?"AI":"Editorial"}),e.jsx("td",{className:"p-2 text-right tabular-nums",children:s.daysLive??"—"}),e.jsx("td",{className:"p-2 text-right tabular-nums",children:c(s.clicks)}),e.jsx("td",{className:"p-2 text-right tabular-nums text-muted-foreground",children:c(s.impressions)}),e.jsx("td",{className:"p-2 text-right tabular-nums",children:s.impressions?d(s.ctr):"—"}),e.jsx("td",{className:"p-2 text-right tabular-nums text-muted-foreground",children:s.position?s.position.toFixed(1):"—"})]},s.articleId))})]})})]})}export{S 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.