1import{r as s,s as p,j as e,L as i}from"./main-Cc8MXM0b.js";import{C as h}from"./chevron-left-wJAKe9ZS.js";import{E as b}from"./eye-BVsP74e9.js";import{L as f}from"./loader-circle-BDgPbVnp.js";import{L as g}from"./lock-B5Cm15DR.js";function k(){const[l,o]=s.useState([]),[n,c]=s.useState(!0),[a,x]=s.useState("TODOS");s.useEffect(()=>{(async()=>{const{data:t}=await p.from("pedagogical_materials").select("id, title, category, credit_cost, thumbnail_url, description").order("created_at",{ascending:!1});o(t??[]),c(!1)})()},[]);const d=["TODOS","KIT","APOSTILA","PAINÃIS INDIVIDUAIS","FOLHA","FOLDER"],r=a==="TODOS"?l:l.filter(t=>t.category===a);return e.jsxs("div",{className:"min-h-screen bg-[#FFFBF3] text-[#1a1a1a]",style:{fontFamily:"'Plus Jakarta Sans', 'Inter', system-ui, sans-serif"},children:[e.jsx("header",{className:"sticky top-0 z-40 bg-white/85 backdrop-blur-xl border-b border-black/5",children:e.jsxs("div",{className:"max-w-7xl mx-auto h-16 px-4 sm:px-6 flex items-center justify-between gap-3",children:[e.jsxs("button",{type:"button",onClick:()=>{typeof window<"u"&&window.history.length>1?window.history.back():window.location.href="/"},className:"inline-flex items-center gap-1.5 text-sm font-bold text-black/80 hover:text-black",children:[e.jsx(h,{className:"w-4 h-4"})," Voltar"]}),e.jsx("h1",{className:"font-black text-base sm:text-lg tracking-tight",children:"Catálogo de Materiais"}),e.jsx(i,{to:"/planos",className:"text-xs sm:text-sm font-bold rounded-xl px-3 py-2 bg-[#7B2FFF] text-white hover:bg-[#8b46ff]",children:"Assinar"})]})}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 pt-5",children:e.jsxs("div",{className:"rounded-2xl border border-[#FDAA3E]/40 bg-[#FDAA3E]/10 px-4 py-3 flex items-center gap-2.5 text-sm text-black/80",children:[e.jsx(b,{className:"w-4 h-4 shrink-0 text-[#EE5A70]"}),e.jsxs("span",{children:["Você está em modo de ",e.jsx("strong",{children:"visualização"}),". Para baixar materiais, escolha um plano."]})]})}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 mt-5 flex flex-wrap gap-2",children:d.map(t=>e.jsx("button",{onClick:()=>x(t),className:`text-xs font-bold uppercase tracking-wider px-3 py-2 rounded-xl border transition-colors ${a===t?"bg-[#1a1a1a] text-white border-[#1a1a1a]":"bg-white text-black/70 border-black/10 hover:border-black/30"}`,children:t},t))}),e.jsx("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-6",children:n?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(f,{className:"w-7 h-7 animate-spin text-[#7B2FFF]"})}):r.length===0?e.jsx("p",{className:"text-center text-black/60 py-20",children:"Nenhum material disponÃvel."}):e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 sm:gap-4",children:r.map(t=>e.jsxs("div",{className:"relative rounded-2xl bg-white border border-black/[0.06] overflow-hidden shadow-sm select-none",style:{pointerEvents:"none"},children:[e.jsxs("div",{className:"aspect-[4/3] bg-gray-100 overflow-hidden",children:[t.thumbnail_url?e.jsx("img",{src:t.thumbnail_url,alt:t.title,loading:"lazy",draggable:!1,className:"w-full h-full object-cover",onContextMenu:m=>m.preventDefault()}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-black/30 text-xs",children:"Sem imagem"}),e.jsxs("div",{className:"absolute top-2 right-2 inline-flex items-center gap-1 bg-black/70 text-white text-[10px] font-bold uppercase tracking-wider px-2 py-1 rounded-full",children:[e.jsx(g,{className:"w-3 h-3"})," Bloqueado"]})]}),e.jsxs("div",{className:"p-3",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-wider text-[#EE5A70]",children:t.category}),e.jsx("h3",{className:"text-sm font-bold text-black/90 leading-tight mt-1 line-clamp-2",children:t.title})]})]},t.id))})}),e.jsx("footer",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-10 text-center",children:e.jsx(i,{to:"/planos",className:"inline-flex items-center justify-center rounded-xl bg-[#FDAA3E] text-[#1a1a1a] px-6 py-3 text-sm font-bold hover:bg-[#fdb95e]",children:"Ver planos e desbloquear downloads"})})]})}export{k 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.