PageSourceSearch

https://kp.gov.pk/assets/FaqScreen-8Uvd1oh1.js

js kp.gov.pk collected 2026-09-24 18:57:56 UTC 2,489 bytes, 1 lines download raw bytes

1import{b as c,r as a,h as j,j as e}from"./index-D43MT5hw.js";import{M as p,P as f}from"./plus-Dlgn9eA5.js";const w=()=>{const{domain:d}=c(),[n,x]=a.useState([]),[m,l]=a.useState(!1),[N,r]=a.useState(null),{text_gredient:u}=c(),[h,i]=a.useState(null),o=a.useCallback(async()=>{l(!0),r(null);try{const s=await j.getFaqs(d),t=s?.data??s?.data?.data??[];x(t),i(t[0]?.uuid??null)}catch(s){console.error("Error fetching faqs:",s),r(s)}finally{l(!1)}},[]);a.useEffect(()=>{o()},[o]);const g=s=>{i(t=>t===s?null:s)};return e.jsxs("div",{className:"min-h-screen bg-slate-50",children:[e.jsxs("div",{className:"mx-auto max-w-3xl text-center py-10",children:[e.jsx("h1",{className:`${u} text-3xl md:text-4xl font-bold `,children:"Frequently Ask Question"}),e.jsx("p",{className:"mt-2 text-sm md:text-base text-slate-600",children:"Find answers to the most common questions below"})]}),e.jsx("div",{className:"mx-auto max-w-[95%] -mt-16 px-4 py-10",children:e.jsx("div",{className:"mt-6 space-y-3 md:max-w-[80%] mx-auto",children:m?e.jsx("div",{className:"rounded-2xl bg-white p-8 text-center text-sm text-slate-600 ring-1 ring-slate-200",children:"Loading..."}):n.length===0?e.jsx("div",{className:"rounded-2xl bg-white p-8 text-center text-sm text-slate-600 ring-1 ring-slate-200",children:"No FAQs found."}):n.map(s=>{const t=h===s.uuid;return e.jsxs("div",{className:"rounded-2xl bg-white ring-1 ring-slate-200 shadow-sm",children:[e.jsxs("button",{type:"button",onClick:()=>g(s.uuid),className:"flex w-full items-center justify-between px-5 py-4 text-left transition hover:bg-slate-50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-slate-100 text-slate-700",children:t?e.jsx(p,{className:"h-5 w-5"}):e.jsx(f,{className:"h-5 w-5"})}),e.jsx("div",{children:e.jsx("div",{className:"text-base font-semibold text-slate-900",children:s.question})})]}),e.jsx("span",{className:"text-xs font-medium text-slate-500",children:"View"})]}),e.jsx("div",{className:`grid transition-all duration-300 ease-in-out ${t?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:e.jsx("div",{className:"overflow-hidden",children:e.jsx("div",{className:"border-t border-slate-200 px-5 py-4",children:e.jsx("div",{className:"prose prose-slate max-w-none text-sm",dangerouslySetInnerHTML:{__html:s.answer}})})})})]},s.uuid)})})})]})},y=()=>e.jsx(e.Fragment,{children:e.jsx(w,{})});export{y 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.