1import{u as f,j as e}from"./vendor-libs-ueW8_MKk.js";import{a as d,A as v,L as c,F as x}from"./vendor-ui-C7TaAcqc.js";import{h as y}from"./index-970JJNzy.js";import{B as m}from"./button-CmqsQZxm.js";import{P as w}from"./PlantCard-BkFLJ3-h.js";import{S as T,s as n}from"./seo-config-DfnsUVCM.js";import{c as C}from"./vendor-react-DHTSZICr.js";import"./vendor-heavy-Crj8Emav.js";function B(){const h=C(),[o,p]=d.useState("todos"),[i,j]=d.useState("todos"),{data:s,isLoading:g}=f({queryKey:["plants"],queryFn:()=>y.entities.Plant.list("-created_date")}),b=[{id:"todos",nome:"Todos os Produtos",icon:"ð¿"},{id:"erva_medicinal",nome:"Ervas Medicinais",icon:"ð¿"},{id:"casca_arvore",nome:"Cascas de Ãrvore",icon:"ð³"}],u=d.useMemo(()=>{if(!s)return[{id:"todos",nome:"Todos os Tratamentos"}];const a=new Set(["todos"]);return(Array.isArray(s)?s:(s==null?void 0:s.items)||[]).forEach(t=>{t.treatment_type&&a.add(t.treatment_type)}),Array.from(a).map(t=>({id:t,nome:t==="todos"?"Todos os Tratamentos":t.charAt(0).toUpperCase()+t.slice(1)}))},[s]),r=d.useMemo(()=>{const a=Array.isArray(s)?s:(s==null?void 0:s.items)||[];return!a||a.length===0?[]:a.filter(l=>{const t=o==="todos"||l.category===o,N=i==="todos"||l.treatment_type===i;return t&&N})},[s,o,i]);return e.jsxs("div",{className:"min-h-screen bg-slate-950",children:[e.jsx(T,{title:"Loja de Ervas Medicinais - Lista Completa",description:"Explore nossa lista de plantas medicinais e encontre as melhores ervas medicinais para seu tratamento natural. Produtos 100% naturais para saúde e bem-estar.",keywords:n.keywords,canonical:"/loja",image:n.defaultImage,jsonLd:n.getBreadcrumbs([{name:"Home",path:"/"},{name:"Loja",path:"/loja"}])}),e.jsx("nav",{className:"sticky top-0 z-50 bg-slate-950/95 backdrop-blur-xl border-b border-emerald-500/20",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 py-4",children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(m,{variant:"ghost",size:"sm",onClick:()=>
1h("/"),className:"text-emerald-100/60 hover:text-emerald-400",children:[e.jsx(v,{className:"w-4 h-4 mr-2"}),"Voltar"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(c,{className:"w-8 h-8 text-emerald-400"}),e.jsx("span",{className:"text-2xl font-bold text-white",children:"Loja de Ervas e Plantas Medicinais"})]})]})})})}),e.jsx("section",{className:"bg-slate-900/50 border-b border-emerald-500/20 py-8",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 space-y-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx(x,{className:"w-5 h-5 text-emerald-400"}),e.jsx("h2",{className:"text-lg font-bold text-white",children:"Categoria do Produto"})]}),e.jsx("div",{className:"flex flex-wrap gap-3",children:b.map(a=>e.jsxs(m,{onClick:()=>p(a.id),className:o===a.id?"bg-emerald-500 hover:bg-emerald-600 text-white":"bg-emerald-500/20 hover:bg-emerald-500/30 text-emerald-100 border border-emerald-500/30",children:[a.icon," ",a.nome]},a.id))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx(x,{className:"w-5 h-5 text-emerald-400"}),e.jsx("h2",{className:"text-lg font-bold text-white",children:"Tipo de Tratamento"})]}),e.jsx("div",{className:"flex flex-wrap gap-3",children:u.map(a=>e.jsx(m,{onClick:()=>j(a.id),className:i===a.id?"bg-emerald-500 hover:bg-emerald-600 text-white":"bg-emerald-500/20 hover:bg-emerald-500/30 text-emerald-100 border border-emerald-500/30",children:a.nome},a.id))})]})]})}),e.jsx("section",{className:"py-12",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h3",{className:"text-3xl font-bold text-white mb-2",children:"Todas as Plantas Medicinais"}),e.jsxs("p",{className:"text-emerald-100/70",children:[(r==null?void 0:r.length)||0," ",(r==null?void 0:r.length)===1?"produto encontrado":"produtos encontrados"]})]}),g?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx("div",{className:"w-8 h-8 border-4 border-emerald-500/20 border-t-emerald-500 animate-spin"})}):(r==null?void 0:r.length)>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:r.map(a=>e.jsx(w,{plant:a},a.id))}):e.jsxs("div",{className:"text-center py-20",children:[e.jsx(c,{className:"w-16 h-16 text-emerald-400/20 mx-auto mb-4"}),e.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"Nenhum produto encontrado"}),e.jsx("p",{className:"text-emerald-100/70",children:"Tente selecionar outra categoria"})]})]})}),e.jsx("footer",{className:"border-t border-emerald-500/20 bg-slate-950 py-8 mt-12",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 text-center",children:e.jsx("p",{className:"text-emerald-100/60",children:"© 2026 Ervas e Ãrvores do Brasil - Fitoterapia Natural"})})})]})}export{B 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.