PageSourceSearch

https://www.trustlinkqatar.com/assets/Blog-DxwiwOUn.js

js trustlinkqatar.com collected 2026-10-04 09:29:42 UTC 8,421 bytes, 1 lines download raw bytes

1import{j as s}from"./ui-vendor-DKm8cimc.js";import{r as e}from"./react-vendor-BmPVsWQ-.js";import{e as a,f as t,u as i,g as l,B as r,h as n,c as o}from"./index-D1M3HNit.js";import{u as c}from"./simpleMetaTags-CIWKpT-s.js";import{b as m,n as d}from"./imagePathUtils-DqywJy2k.js";import{D as p,a as x,E as u,H as g,R as h}from"./lucide-vendor-CeMWj2yY.js";import{B as j}from"./BlogPostCard-C_q_iYPr.js";import"./utils-vendor-BbncCth-.js";import"./BlogImage-BEV44MxR.js";function N({className:e,...t}){return s.jsx("div",{className:a("animate-pulse rounded-md bg-muted",e),...t})}const f=({className:e,...t})=>s.jsx("nav",{role:"navigation","aria-label":"pagination",className:a("mx-auto flex w-full justify-center",e),...t});f.displayName="Pagination";const y=e.forwardRef(({className:e,...t},i)=>s.jsx("ul",{ref:i,className:a("flex flex-row items-center gap-1",e),...t}));y.displayName="PaginationContent";const w=e.forwardRef(({className:e,...t},i)=>s.jsx("li",{ref:i,className:a("",e),...t}));w.displayName="PaginationItem";const v=({className:e,isActive:i,size:l="icon",...r})=>s.jsx("a",{"aria-current":i?"page":void 0,className:a(t({variant:i?"outline":"ghost",size:l}),e),...r});v.displayName="PaginationLink";const b=({className:e,...t})=>s.jsxs(v,{"aria-label":"Go to previous page",size:"default",className:a("gap-1 ps-2.5",e),...t,children:[s.jsx(p,{className:"h-4 w-4"}),s.jsx("span",{children:"Previous"})]});b.displayName="PaginationPrevious";const k=({className:e,...t})=>s.jsxs(v,{"aria-label":"Go to next page",size:"default",className:a("gap-1 pe-2.5",e),...t,children:[s.jsx("span",{children:"Next"}),s.jsx(x,{className:"h-4 w-4"})]});k.displayName="PaginationNext";const P=({className:e,...t})=>s.jsxs("span",{"aria-hidden":!0,className:a("flex h-9 w-9 items-center justify-center",e),...t,children:[s.jsx(u,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"More pages"})]});P.displayName="PaginationEllipsis";const C=()=>{const{t:a}=i("blog"),[t,p]=e.useState([]),[x,u]=e.useState(!0),[C,A]=e.useState(null),{toast:_}=l(),[B,T]=e.useState(1),[q,S]=e.useState(null),[z,L]=e.useState(0);e.useEffect(()=>{c(a("page.title"),a("page.description"),a("page.keywords"))},[a]);const E=e.useCallback(async()=>{u(!0),A(null);try{const s=await m.getAllPosts(B,9);if(s&&s.error)return A(s.error),p([]),void S(null);let e=[],a=null;if(Array.isArray(s)){e=s;const t=9*(B-1),i=t+9,l=s.length;a={page:B,limit:9,total:l,totalPages:Math.ceil(l/9),hasNextPage:i<l,hasPreviousPage:B>1},e=s.slice(t,i)}else s&&s.posts&&Array.isArray(s.posts)?(e=s.posts,a=s.pagination):(e=[],a=null);if(e.length>0){const s=e.map(s=>{const e=d(s);return e.cover_image&&e.cover_image.includes("?")&&(e.cover_image=e.cover_image.split("?")[0]),e.card_image&&e.card_image.includes("?")&&(e.card_image=e.card_image.split("?")[0]),e});p(s),S(a)}else p([]),S(null)}catch(s){let e=s instanceof Error?s.message:"Failed to load articles";A(e),p([]),S(null),_({title:a("error.title"),description:a("error.description"),variant:"destructive"})}finally{u(!1)}},[B,_,a]);e.useEffect(()=>{E()},[E]);const M=s=>{!q||s<1||s>q.totalPages||(T(s),window.scrollTo({top:0,behavior:"smooth"}))},Q={"@context":"https://schema.org","@type":"Blog",name:"TrustLink Business Blog",description:"Stay updated with the latest business setup news, company formation guides, and legal updates for doing business in Qatar.",url:"https://www.trustlinkqatar.com/blog",publisher:{"@type":"Organization",name:"TrustLink",url:"https://www.trustlinkqatar.com",logo:{"@type":"ImageObject",url:"https://www.trustlinkqatar.com/assets/images/trustlink-logo.png"}},about:{"@type":"Thing",name:"Business Formation and Company Setup in Qatar",description:"Expert insights on company formation, business setup, legal requirements, and entrepreneurship in Qatar"},inLanguage:"en",keywords:"Qatar business insights, Company formation guides, Business setup Qatar, Legal requirements Qatar"};return t.length>0&&(Q.blogPost=t.slice(0,5).map(s=>({"@type":"BlogPosting",headline:s.title,description:s.meta_description||s.excerpt||s.content.substring(0,160),url:`https://www.trustlinkqatar.com/${s.slug}`,datePublished:s.created_at,dateModified:s.updated_at,author:{"@type":"Organization",name:s.author||"TrustLink"},publisher:{"@type":"Organization",name:"TrustLink",logo:{"@type":"ImageObject",url:"https://www.trustlinkqatar.com/assets/images/trustlink-logo.png"}},image:s.cover_image||"https://www.trustlinkqatar.com/assets/images/trustlink-default-blog.jpg"}))),s.jsxs(r,{children:[s.jsx(n,{data:Q}),s.jsx("div",{className:"bg-gradient-to-b from-primary to-primary/90 text-white py-12 sm:py-16 md:py-20 pt-[180px] md:pt-[200px] lg:pt-20",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsxs("div",{className:"text-center max-w-4xl mx-auto",children:[s.jsx("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-bold mb-4 sm:mb-6",children:a("hero.title")}),s.jsx("p",{className:"text-lg sm:text-xl text-white/90 leading-relaxed",children:a("hero.subtitle")})]})})}),s.jsx("div",{className:"container mx-auto px-4 py-8 sm:py-12 md:py-16",children:x?s.jsx("div",{className:"space-y-8",children:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 lg:gap-8",children:Array.from({length:9}).map((e,a)=>s.jsxs("div",{className:"bg-white rounded-2xl border border-gray-200 shadow-sm overflow-hidden",children:[s.jsx(N,{className:"h-[220px] w-full"}),s.jsxs("div",{className:"p-7 space-y-4",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx(N,{className:"h-4 w-24"}),s.jsx(N,{className:"h-4 w-20"})]}),s.jsx(N,{className:"h-7 w-full"}),s.jsx(N,{className:"h-7 w-3/4"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx(N,{className:"h-4 w-full"}),s.jsx(N,{className:"h-4 w-full"}),s.jsx(N,{className:"h-4 w-2/3"})]}),s.jsx("div",{className:"pt-2 border-t border-gray-100",children:s.jsx(N,{className:"h-5 w-32"})})]})]},a))})}):C?s.jsx("div",{className:"w-full py-16",children:s.jsxs("div",{className:"text-center max-w-md mx-auto",children:[s.jsx(g,{className:"h-16 w-16 text-red-500 mx-auto mb-4"}
1),s.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2",children:a("error.title")}),s.jsx("p",{className:"text-gray-600 mb-6",children:a("error.description")}),s.jsxs(o,{onClick:()=>{L(s=>s+1),E()},className:"inline-flex items-center gap-2",children:[s.jsx(h,{className:"h-4 w-4"}),a("error.buttonText")]})]})}):0===t.length?s.jsx("div",{className:"text-center py-16",children:s.jsxs("div",{className:"max-w-md mx-auto",children:[s.jsx("div",{className:"h-16 w-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(g,{className:"h-8 w-8 text-gray-400"})}),s.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2",children:a("empty.title")}),s.jsx("p",{className:"text-gray-600 mb-6",children:a("empty.description")}),s.jsxs(o,{onClick:E,className:"inline-flex items-center gap-2",children:[s.jsx(h,{className:"h-4 w-4"}),a("empty.buttonText")]})]})}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 lg:gap-8",children:t.map(e=>s.jsx(j,{post:e,to:`/${e.slug}`,className:"hover:shadow-xl transition-all duration-300"},e.id))}),q&&q.totalPages>1&&s.jsx("div",{className:"mt-12 flex justify-center",children:s.jsx(f,{children:s.jsxs(y,{children:[s.jsx(w,{children:s.jsx(b,{onClick:()=>M(B-1),className:"cursor-pointer "+(q.hasPreviousPage?"":"pointer-events-none opacity-50")})}),(()=>{if(!q)return null;const{totalPages:e}=q;if(e<=5)return Array.from({length:e}).map((e,a)=>s.jsx(w,{children:s.jsx(v,{isActive:B===a+1,onClick:()=>M(a+1),className:"cursor-pointer",children:a+1})},a));const a=[];a.push(s.jsx(w,{children:s.jsx(v,{isActive:1===B,onClick:()=>M(1),className:"cursor-pointer",children:"1"})},"first")),B>3&&a.push(s.jsx(w,{children:s.jsx(P,{})},"ellipsis-1"));const t=Math.max(2,B-1),i=Math.min(e-1,B+1);for(let l=t;l<=i;l++)l>1&&l<e&&a.push(s.jsx(w,{children:s.jsx(v,{isActive:B===l,onClick:()=>M(l),className:"cursor-pointer",children:l})},l));return B<e-2&&a.push(s.jsx(w,{children:s.jsx(P,{})},"ellipsis-2")),e>1&&a.push(s.jsx(w,{children:s.jsx(v,{isActive:B===e,onClick:()=>M(e),className:"cursor-pointer",children:e})},"last")),a})(),s.jsx(w,{children:s.jsx(k,{onClick:()=>M(B+1),className:"cursor-pointer "+(q.hasNextPage?"":"pointer-events-none opacity-50")})})]})})})]})})]})};export{C 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.