PageSourceSearch

https://msastroacademy.com/assets/study-materials-VeJypVoO.js

js msastroacademy.com collected 2026-10-02 01:37:28 UTC 4,806 bytes, 1 lines download raw bytes

1import{r as n,j as e}from"./react-vendor-DDlTsOEd.js";import{d as y,s as f,F as p,ad as j,k as g,ac as N,l as b,aR as w}from"./index-BBAL-XO_.js";import{A as v}from"./AdminLayout-B0DIBAYd.js";import{S as c}from"./skeleton-DBoY5sj-.js";import{D as k}from"./download-R40uOQxN.js";import"./megaphone-c2Ccoqv-.js";import"./clipboard-check-B-VFQxDc.js";import"./database-CfQ3DoFp.js";import"./tag-finmna5A.js";import"./credit-card-jC5ykv7d.js";async function S(o,d){const r=b(),l=await fetch(w(o),{headers:r?{Authorization:`Bearer ${r}`}:{}});if(!l.ok)throw new Error(`download failed: ${l.status}`);const i=URL.createObjectURL(await l.blob());try{const s=document.createElement("a");s.href=i,s.download=`${d}.pdf`.replace(/[\\/:*?"<>|]/g,"-"),document.body.appendChild(s),s.click(),s.remove()}finally{setTimeout(()=>URL.revokeObjectURL(i),6e4)}}function $(){const[o,d]=n.useState([]),[r,l]=n.useState(!0),[i,s]=n.useState(""),[u,x]=n.useState(null);n.useEffect(()=>{y.get("/admin/lessons").then(t=>{const a=t.data??[];d(a.filter(h=>h.pdfUrl&&h.pdfUrl.trim()!==""))}).finally(()=>l(!1))},[]);const m=o.filter(t=>{const a=i.toLowerCase();return!a||t.title.toLowerCase().includes(a)||t.courseTitle.toLowerCase().includes(a)});return e.jsx(v,{children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Study Materials"}),e.jsx("p",{className:"text-sm text-gray-900 mt-0.5",children:r?"…":`${o.length} PDFs and resources across all courses`})]}),e.jsxs("div",{className:"relative max-w-md",children:[e.jsx(f,{size:15,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-900"}),e.jsx("input",{value:i,onChange:t=>s(t.target.value),placeholder:"Search materials...",className:"w-full pl-9 pr-4 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-200"})]}),e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden",children: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:"text-xs text-gray-900 uppercase tracking-wider border-b border-gray-100",children:[e.jsx("th",{className:"text-left px-5 py-3 font-medium",children:"Material"}),e.jsx("th",{className:"text-left px-3 py-3 font-medium",children:"Course"}),e.jsx("th",{className:"text-left px-3 py-3 font-medium",children:"Added"}),e.jsx("th",{className:"px-3 py-3 font-medium text-right",children:"Actions"})]})}),e.jsxs("tbody",{className:"divide-y divide-gray-50",children:[r?Array.from({length:6}).map((t,a)=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-5 py-3",children:e.jsx(c,{className:"h-3 w-40 bg-gray-100"})}),e.jsx("td",{className:"px-3 py-3",children:e.jsx(c,{className:"h-3 w-32 bg-gray-100"})}),e.jsx("td",{className:"px-3 py-3",children:e.jsx(c,{className:"h-3 w-20 bg-gray-100"})}),e.jsx("td",{className:"px-3 py-3"})]},a)):m.map(t=>e.jsxs("tr",{className:"hover:bg-gray-50 transition-colors",children:[e.jsx("td",{className:"px-5 py-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-50 flex items-center justify-center shrink-0",children:e.jsx(p,{size:18,className:"text-blue-500"})}),e.jsx("span",{className:"font-medium text-gray-900 truncate max-w-[200px]",children:t.title})]})}),e.jsx("td",{className:"px-3 py-3 text-gray-800 truncate max-w-[160px]",children:t.courseTitle}),e.jsx("td",{className:"px-3 py-3 text-gray-800 text-xs whitespace-nowrap",children:new Date(t.createdAt).toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"2-digit"})}),e.jsx("td",{className:"px-3 py-3",children:e.jsxs("div",{className:"flex items-center gap-3 justify-end",children:[e.jsx("button",{type:"button",disabled:u===t.id,className:"text-blue-500 hover:text-blue-700 transition-colors disabled:opacity-40",title:"Download",onClick:async()=>{x(t.id);try{await S(t.pdfUrl,t.title)}catch{j({title:"Download failed",description:"This file couldn't be fetched. Open it in the Course Builder to check the link.",variant:"destructive"})}finally{x(null)}},children:e.jsx(k,{size:15})}),e.jsx(g,{href:`/admin/courses/${t.courseId}/builder`,children:e.jsx("button",{className:"text-gray-900 hover:text-gray-600 transition-colors",title:"Edit in Builder",children:e.jsx(N,{size:14})})})]})})]},t.id)),!r&&m.length===0&&e.jsx("tr",{children:e.jsxs("td",{colSpan:4,className:"px-5 py-12 text-center",children:[e.jsx(p,{size:36,className:"text-gray-900 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-900 text-sm",children:"No study materials found"}),e.jsx("p",{className:"text-gray-900 text-xs mt-1",children:"Upload PDFs to lessons in the Course Builder"})]})})]})]})})})]})})}export{$ 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.