PageSourceSearch

https://ai.trintaporcento.com.br/assets/faq._area-I4OksEuo.js

js trintaporcento.com.br collected 2026-10-06 04:45:01 UTC 3,198 bytes, 1 lines download raw bytes

1import{R as f,g as h,r as a,s as c,j as e,L as j,A as N}from"./index-CIcepXs3.js";import{c as v}from"./utils-DCADjnpI.js";import{A as b}from"./arrow-left-BeKQnb-K.js";import{M as w}from"./message-square-BGsbd353.js";import{T as q}from"./trending-up-B_9VS8HW.js";function L(){const{areaSlug:t}=f.useLoaderData();h(t);const[d,l]=a.useState([]),[m,n]=a.useState(!0),[r,x]=a.useState(t),[i,u]=a.useState(null);a.useEffect(()=>{g()},[r]);async function g(){n(!0);const{data:s}=await c.from("knowledge_areas").select("id").eq("slug",r).single();let o=c.from("faq_entries").select("id, question, answer, frequency, area_id, last_asked").order("frequency",{ascending:!1}).limit(30);s&&(o=o.eq("area_id",s.id));const{data:p}=await o;l(p??[]),n(!1)}return e.jsxs("div",{className:"mx-auto max-w-4xl p-8",children:[e.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[e.jsx(j,{to:"/chat/$area",params:{area:t},className:"rounded-md p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:e.jsx(b,{className:"size-4"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-2xl",children:"Perguntas Frequentes"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"As dúvidas mais comuns dos usuários, organizadas por área."})]})]}),e.jsx("div",{className:"mb-6 flex flex-wrap gap-2",children:N.map(s=>e.jsx("button",{onClick:()=>x(s.slug),className:v("rounded-full px-4 py-1.5 text-sm transition-colors",r===s.slug?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent hover:text-foreground"),children:s.shortName},s.slug))}),m?e.jsx("div",{className:"py-12 text-center text-sm text-muted-foreground",children:"Carregando…"}):d.length===0?e.jsxs("div",{className:"flex flex-col items-center py-12 text-center",children:[e.jsx(w,{className:"mb-3 size-10 text-muted-foreground/50"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma pergunta frequente registrada nesta área ainda."}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground/70",children:"As perguntas são registradas automaticamente conforme os usuários interagem com o chat."})]}):e.jsx("div",{className:"space-y-3",children:d.map(s=>e.jsxs("div",{className:"rounded-lg border border-border bg-card transition-shadow hover:shadow-sm",children:[e.jsxs("button",{onClick:()=>u(i===s.id?null:s.id),className:"flex w-full items-center gap-3 px-5 py-4 text-left",children:[e.jsx("div",{className:"flex-1",children:e.jsx("p",{className:"text-sm font-medium text-foreground",children:s.question})}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(q,{className:"size-3"}),s.frequency,"x"]})]}),i===s.id&&e.jsxs("div",{className:"border-t border-border px-5 py-4",children:[e.jsx("div",{className:"prose prose-sm max-w-none text-foreground/80",children:e.jsx("p",{className:"whitespace-pre-wrap text-sm",children:s.answer})}),e.jsxs("p",{className:"mt-3 text-[11px] text-muted-foreground",children:["Última vez perguntado:"," ",new Date(s.last_asked).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric"})]})]})]},s.id))})]})}export{L 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.