PageSourceSearch

https://polarizationresearchlab.org/assets/AdminDashboard-fKm8PLIG.js

js polarizationresearchlab.org collected 2026-09-25 04:28:00 UTC 3,783 bytes, 1 lines download raw bytes

1import{r as a,j as e}from"./vendor-chartjs-DAQApR3A.js";import{u as h}from"./AdminToastContext-CgqwTXQu.js";import{L as u}from"./index-VXtZNIH-.js";import"./vendor-recharts-KyLwo51t.js";import"./vendor-maps-DjSiDsVE.js";function N(){const[t,l]=a.useState({mediaMentions:0,reports:0,violenceEvents:0}),[r,i]=a.useState(!0),{showError:n}=h();a.useEffect(()=>{async function s(){try{const[o,d,m]=await Promise.all([fetch("/data/mediaMentions.json"),fetch("/news/index.json"),fetch("/violence/events.json")]),x=await o.json(),f=await d.json(),p=await m.json();l({mediaMentions:x.length,reports:f.articles.length,violenceEvents:p.length})}catch(o){n("Failed to load dashboard stats",o)}finally{i(!1)}}s()},[n]);const c=[{title:"Media Mentions",count:t.mediaMentions,icon:"bi-newspaper",color:"#3b82f6",link:"/admin/media"},{title:"Reports",count:t.reports,icon:"bi-file-text",color:"#10b981",link:"/admin/reports"},{title:"Violence Events",count:t.violenceEvents,icon:"bi-exclamation-triangle",color:"#ef4444",link:"/admin/violence"}];return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold",style:{color:"var(--text-primary)"},children:"Admin Dashboard"}),e.jsx("p",{className:"text-sm mt-1",style:{color:"var(--text-secondary)"},children:"Manage content for America's Political Pulse"})]}),r?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[1,2,3].map(s=>e.jsx("div",{className:"p-6 rounded-xl animate-pulse",style:{background:"var(--bg-secondary)",height:"120px"}},s))}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:c.map(s=>e.jsxs(u,{to:s.link,className:"p-6 rounded-xl transition-all hover:scale-[1.02]",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",textDecoration:"none"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("i",{className:`bi ${s.icon} text-2xl`,style:{color:s.color}}),e.jsx("span",{className:"text-3xl font-bold",style:{color:"var(--text-primary)"},children:s.count})]}),e.jsx("h3",{className:"font-medium",style:{color:"var(--text-primary)"},children:s.title}),e.jsx("p",{className:"text-sm mt-1",style:{color:"var(--text-muted)"},children:"Click to manage"})]},s.title))}),e.jsxs("div",{className:"mt-8 p-6 rounded-xl",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:[e.jsx("h2",{className:"font-bold mb-4",style:{color:"var(--text-primary)"},children:"How to Use"}),e.jsxs("ol",{className:"space-y-3 text-sm",style:{color:"var(--text-secondary)"},children:[e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold",style:{background:"var(--accent)",color:"#fff"},children:"1"}),e.jsx("span",{children:"Select a content type from the sidebar to add, edit, or delete items"})]}),e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold",style:{background:"var(--accent)",color:"#fff"},children:"2"}),e.jsx("span",{children:"Make your changes using the forms provided"})]}),e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold",style:{background:"var(--accent)",color:"#fff"},children:"3"}),e.jsx("span",{children:'Click "Export" to download updated JSON files'})]}),e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold",style:{background:"var(--accent)",color:"#fff"},children:"4"}),e.jsx("span",{children:"Replace the files in the repository and redeploy"})]})]})]})]})}export{N as AdminDashboard};

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.