PageSourceSearch

https://www.todamateria.com.br/layout/assets/dist/js/Cadernos.CDi2S8N-.js

js todamateria.com.br collected 2026-09-24 17:43:03 UTC 5,599 bytes, 2 lines download raw bytes

1import{g,a as f,r as j,j as e,L as p,R as b,P as N}from"./lume.stSJJIAt.js";import{u as v}from"./useQuery.BcvEheqj.js";import{C as w,P as k}from"./CadernoCard.DSRNvgw7.js";import{a as C,S as i}from"./Skeleton.CBLFtp1q.js";import{C as y}from"./chevron-left.DbAeVLO9.js";import{C as P}from"./chevron-right.BzXmbsaZ.js";import"./_commonjsHelpers.CqkleIqs.js";import"./auth-cookies.Cq4KilpJ.js";import"./analytics.Yss8y0c9.js";import"./clicks-tracker.BNwCWQuc.js";import"./funnel-tracker.2rTqlksa.js";import"./v4.CtRu48qb.js";import"./preload-helper.CXnpAtHY.js";import"./exam-date.ChnrdXu1.js";import"./progress.CkEm-RqI.js";import"./subject-style.CiDryuyS.js";import"./book-open.DOTM5eoW.js";import"./progress.BHt3xTMF.js";import"./ProgressBar.BqYW_QHy.js";import"./clipboard-list.BHE73RVC.js";import"./target.DcWpKpgI.js";import"./layout-grid.DREkhKzr.js";const E=g("/authenticated/hub/cadernos");function se(){var c;const{page:s}=E.useSearch(),{data:r,error:a,isPending:t,isFetching:n,isPlaceholderData:u,refetch:h}=v(N(s)),d=f(),o=r==null?void 0:r.page;j.useEffect(()=>{o!==void 0&&o!==s&&d({replace:!0,search:{page:o},to:"/cadernos"})},[d,s,o]);const l=r!==void 0&&r.total===0;return e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-x-6 gap-y-5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-[clamp(26px,3.6vw,38px)]/[1.08] font-bold tracking-tight",children:"Meus cadernos"}),e.jsx("p",{className:"mt-2.5 max-w-[560px] text-[14px]/[1.6] font-medium text-neutral-500",children:l?"Você ainda não tem nenhum caderno.":"".concat((c=r==null?void 0:r.total)!=null?c:""," ").concat((r==null?void 0:r.total)===1?"caderno":"cadernos"," — escolha um para voltar aos seus estudos.")})]}),e.jsx(S,{})]}),e.jsxs("div",{className:"mt-8",children:[t&&e.jsx(A,{}),!t&&a&&e.jsx($,{isRetrying:n,message:a.message,onRetry:()=>void h()}),!t&&!a&&l&&e.jsx(R,{}),!t&&!a&&r&&r.total>0&&e.jsxs(e.Fragment,{children:[e.jsx("ul",{className:"grid gap-4 transition-opacity md:grid-cols-2 xl:grid-cols-3 ".concat(u?"opacity-50":""),children:r.items.map(m=>e.jsx("li",{children:e.jsx(w,{caderno:m})},m.id))}),e.jsx(L,{page:r.page,totalPages:r.totalPages})]})]})]})}function L({page:s,totalPages:r}){return r<=1?null:e.jsxs("nav",{"aria-label":"Páginas de cadernos",className:"mt-7 flex items-center justify-center gap-2",children:[e.jsx(x,{direction:"prev",disabled:s<=1,page:s-1}),e.jsxs("span",{"aria-current":"page",className:"min-w-[7.5rem] text-center text-[13px]/none font-semibold text-neutral-500",children:["Página ",s," de ",r]}),e.jsx(x,{direction:"next",disabled:s>=r,page:s+1})]})}const z={prev:"Página anterior",next:"Próxima página"};function x({page:s,direction:r,disabled:a}){const t=r==="prev"?y:P,n=z[r];return a?e.jsx("span",{"aria-disabled":"true","aria-label":n,className:"grid size-9 place-items-center rounded-xl border border-ink/10 text-neutral-400",children:e.jsx(t,{"aria-hidden":"true",className:"size-4"})}):e.jsx(p,{"aria-label":n,className:"grid size-9 place-items-center rounded-xl border border-ink/15 text-ink transition hover:border-main-400",search:{page:s},to:"/cadernos",children:e.jsx(t,{"aria-hidden":"true",className:"size-4"})})}function S(){return e.jsx("div",{className:"flex w-full flex-wrap items-center gap-2.5 sm:w-auto sm:shrink-0",children:e.jsxs(p,{className:"inline-flex grow justify-center items-center gap-2 rounded-full bg-main-500 px-5 py-3 text-[13px]/none font-semibold whitespace-nowrap text-white shadow-[0_8px_26px_rgba(62,69,235,0.35)] transition hover:bg-main-600 sm:grow-0",search:{},to:"/novo",children:[e.jsx(k,{"aria-hidden":"true",className:"size-4",strokeWidth:2.5}),"Criar caderno"]})})}function R(){return e.jsxs("div",{className:"rounded-[20px] border border-dashed border-ink/15 px-6 py-9 text-center",children:[e.jsx("p",{className:"text-[15px]/snug font-bold text-ink",children:"Você ainda não tem nenhum caderno."}),e.jsx("p",{className:"mx-auto mt-2 max-w-[380px] text-[13.5px]/relaxed font-medium text-neutral-500",children:"Crie o seu primeiro cadern
1o lá em cima e eu monto o plano de estudos com você."})]})}function $({message:s,onRetry:r,isRetrying:a}){return e.jsxs("div",{className:"rounded-[20px] border border-danger-500/40 bg-danger-500/10 px-5 py-4.5",role:"alert",children:[e.jsx("p",{className:"text-[13.5px]/tight font-bold text-ink",children:"Não foi possível carregar os seus cadernos"}),e.jsx("p",{className:"mt-1 text-[13px]/relaxed font-medium text-neutral-500",children:s}),e.jsxs("button",{className:"mt-3.5 inline-flex items-center gap-2 rounded-full border-[1.5px] border-ink/20 px-4 py-2.5 text-[12.5px]/none font-semibold transition ".concat(a?"cursor-not-allowed text-neutral-400":"cursor-pointer text-ink hover:border-main-400"),disabled:a,onClick:r,type:"button",children:[e.jsx(b,{"aria-hidden":"true",className:"size-3.5 ".concat(a?"animate-spin":"")}),a?"Tentando…":"Tentar de novo"]})]})}function A(){return e.jsx(C,{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",label:"Carregando os seus cadernos…",children:[0,1,2,3,4,5].map(s=>e.jsxs("div",{className:"rounded-[20px] border border-ink/8 bg-surface-card p-5",children:[e.jsx(i,{className:"h-5 w-40",rounded:"rounded-md"}),e.jsx(i,{className:"mt-3 h-3 w-28",rounded:"rounded-md"}),e.jsx("div",{className:"mt-4 flex gap-1.5",children:[0,1,2,3].map(r=>e.jsx(i,{className:"size-7",rounded:"rounded-[9px]"},r))}),e.jsx(i,{className:"mt-8 h-1.5 w-full",rounded:"rounded-full"})]},s))})}export{se as default};
2//# sourceMappingURL=Cadernos.CDi2S8N-.js.map

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.