PageSourceSearch

https://site-multibrand.web.app/assets/BookView-D3PIg5v3.js

js site-multibrand.web.app collected 2026-10-03 12:35:49 UTC 4,220 bytes, 1 lines download raw bytes

1import{f as w,C as B,p as V,r as p,c as A,t as F,D as P,h as r,v as n,i as t,x as R,A as e,B as c,z as g,E as x,F as S,G as E,H as I,I as N,j as l,J as m,K as j}from"./index-DYwMVYTK.js";import{u as z,P as D}from"./ProductCard-ChiO1MMh.js";import{A as L}from"./AppHeader-BRLi6AWo.js";import{A as T}from"./AppFooter-vfSXuPZT.js";const H={class:"book-view"},q={class:"container mx-auto px-4 py-8"},G={key:0,class:"text-center py-16"},J={key:1,class:"grid lg:grid-cols-2 gap-8"},K={class:"flex justify-center"},M=["src","alt"],U={class:"space-y-6"},$={class:"text-3xl font-bold text-navy-blue mb-2"},O={class:"text-xl text-gray-600 mb-4"},Q={class:"text-gray-700 leading-relaxed"},W={class:"grid grid-cols-2 gap-4 text-sm"},X={class:"ml-2"},Y={class:"ml-2"},Z={class:"ml-2"},tt={class:"ml-2"},ot={class:"flex gap-4"},st=["disabled"],et={key:2,class:"text-center py-16"},at={key:3,class:"container mx-auto px-4 py-8"},lt={class:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 gap-[3px]"},ct=w({__name:"BookView",setup(rt){const _=P(),h=N(),C=B(),i=z(),{isPeraBook:d}=V(),s=p(null),b=p(!0),u=p(!1),f=A(()=>s.value?i.products.filter(a=>a.id!==s.value.id&&(a.category===s.value.category||a.author===s.value.author)).slice(0,7):[]),k=async()=>{if(s.value){u.value=!0;try{C.addItem(s.value),await h.push("/cart")}catch(a){console.error("Erro ao adicionar ao carrinho:",a),u.value=!1}}};return F(async()=>{const a=_.params.id;i.products.length===0&&await i.loadProducts(),s.value=i.products.find(o=>o.id===a)||null,b.value=!1}),(a,o)=>{const v=S("router-link");return l(),r("div",H,[n(L),t("div",q,[b.value?(l(),r("div",G,[...o[0]||(o[0]=[t("div",{class:"text-4xl mb-4"},"📚",-1),t("p",null,"Carregando livro...",-1)])])):s.value?(l(),r("div",J,[t("div",K,[t("img",{src:s.value.image,alt:s.value.title,class:"w-full max-w-md rounded-lg shadow-lg object-contain",loading:"lazy",decoding:"async"},null,8,M)]),t("div",U,[t("div",null,[t("h1",$,e(s.value.title),1),t("p",O,"por "+e(s.value.author),1),t("p",{class:c(["text-2xl font-bold",g(d)?"text-[#83C7C6]":"text-orange-gold"])},"R$ "+e(s.value.price.toFixed(2).replace(".",",")),3)]),t("div",null,[o[1]||(o[1]=t("h3",{class:"text-lg font-semibold text-navy-blue mb-2"},"Descrição",-1)),t("p",Q,e(s.value.description||"Uma história encantadora que vai cativar leitores de todas as idades."),1)]),t("div",W,[t("div",null,[o[2]||(o[2]=t("span",{class:"font-semibold"},"Categoria:",-1)),t("span",X,e(s.value.category),1)]),t("div",null,[o[3]||(o[3]=t("span",{class:"font-semibold"},"Faixa Etária:",-1)),t("span",Y,e(s.value.ageRange),1)]),t("div",null,[o[4]||(o[4]=t("span",{class:"font-semibold"},"Ilustrador:",-1)),t("span",Z,e(s.value.illustrator),1)]),t("div",null,[o[5]||(o[5]=t("span",{class:"font-semibold"},"Páginas:",-1)),t("span",tt,e(s.value.pages||"32")+" páginas",1)])]),t("div",ot,[t("button",{onClick:k,disabled:u.value,class:c(["flex-1 text-white py-3 px-6 rounded-lg disabled:opacity-50 font-semibold",g(d)?"bg-[#83C7C6] hover:bg-[#6ab0af]":"bg-orange-gold hover:bg-orange-600"])},e(u.value?"Adicionando...":"🛒 Adicionar ao Carrinho"),11,st),n(v,{to:"/cart",class:c(["text-white py-3 px-6 rounded-lg font-semibold",g(d)?"bg-[#19988B] hover:bg-[#147a70]":"bg-navy-blue hover:bg-navy-blue/90"])},{default:x(()=>[...o[6]||(o[6]=[m(" Ver Carrinho ",-1)])]),_:1},8,["class"])]),n(v,{to:"/catalog",class:c(["inline-flex items-center",g(d)?"text-[#83C7C6] hover:text-[#6ab0af]":"text-orange-gold hover:text-orange-600"])},{default:x(()=>[...o[7]||(o[7]=[m(" ← Voltar ao Catálogo ",-1)])]),_:1},8,["class"])])])):(l(),r("div",et,[o[9]||(o[9]=t("div",{class:"text-4xl mb-4"},"❌",-1)),o[10]||(o[10]=t("h2",{class:"text-xl text-gray-600 mb-4"},"Livro não encontrado",-1)),n(v,{to:"/catalog",class:"bg-orange-gold text-white px-6 py-3 rounded-lg hover:bg-orange-600"},{default:x(()=>[...o[8]||(o[8]=[m(" Voltar ao Catálogo ",-1)])]),_:1})])),s.value&&f.value.length>0?(l(),r("div",at,[o[11]||(o[11]=t("h2",{class:"text-2xl font-bold text-navy-blue mb-6"},"Livros Relacionados",-1)),t("div",lt,[(l(!0),r(E,null,I(f.value,y=>(l(),j(D,{key:y.id,product:y},null,8,["product"]))),128))])])):R("",!0)]),n(T)])}}});
1export{ct 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.