Files
soft_usite/dist/assets/AskFrequentlyView-NP7wENWQ.js
T
2025-02-06 14:22:29 -05:00

2 lines
2.0 KiB
JavaScript

import{S as x}from"./SectionTitle-CrHOP_mf.js";import{I as h}from"./IconoLlama-BavanhPF.js";import{g as y,_ as b,u as q,c as p,r as C,d as e,f as m,F as _,b as s,l as g,w as F,m as V,t as w,e as n,i as B,z as T,s as A}from"./index-BmU8V2V2.js";const L=async()=>{try{const{data:o}=await y.get("/preguntas-frecuentes-all");return o}catch(o){throw console.log(o),new Error("Error getting preguntas frecuentes")}},M=["onClick"],N={class:"flex items-center"},j={class:"font-medium"},E={key:0,xmlns:"http://www.w3.org/2000/svg",class:"flex-shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},I={key:1,xmlns:"http://www.w3.org/2000/svg",class:"flex-shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},S={key:0,class:"p-4"},z=["innerHTML"],H={__name:"AskFrequentlyView",setup(o){const{data:l}=q({queryKey:["preguntasFrecuentes"],queryFn:()=>L(),staleTime:6e4}),f=p(()=>{var t;return((t=l==null?void 0:l.value)==null?void 0:t.categorias)||[]}),u=p(()=>A.contrast),r=C({}),k=t=>{r.value[t]=!r.value[t]};return(t,a)=>(s(!0),e(_,null,m(f.value,c=>(s(),e("div",{class:"faq-container mx-auto py-8 px-4 sm:px-6 lg:px-8 max-w-5xl select-none",key:c.id},[g(x,null,{default:F(()=>[V(w(c.categoria_nombre),1)]),_:2},1024),(s(!0),e(_,null,m(c.preguntas,({pregunta:d,respuesta:v,id:i})=>(s(),e("div",{key:d.id,class:"faq-item mb-2"},[n("div",{onClick:O=>k(i),class:B([{"bg-black":u.value,"bg-white":!u.value},"cursor-pointer shadow-[0_5px_5px_rgba(0,0,0,0.1)] rounded-lg p-4 flex items-center justify-between"])},[n("div",N,[g(h),n("span",j,w(d),1)]),r.value[i]?(s(),e("svg",E,a[0]||(a[0]=[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 15l7-7 7 7"},null,-1)]))):(s(),e("svg",I,a[1]||(a[1]=[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])))],10,M),r.value[i]?(s(),e("div",S,[n("p",{class:"mb-4 faq-response",innerHTML:v},null,8,z)])):T("",!0)]))),128))]))),128))}},$=b(H,[["__scopeId","data-v-5af61f57"]]);export{$ as default};