import{j as e}from"./vendor-radix-DNp60FuA.js";import{L as d}from"./vendor-react-DL0tRKZA.js";import{u as n}from"./vendor-query-CKQAY9LX.js";import{j as c}from"./supabase-queries-e10iBk2L.js";import{s as x,k as h}from"./index-CzsKMdZJ.js";import{u}from"./useJobs-DtUCNdQ5.js";import{S as o}from"./skeleton-DYdkaAf-.js";import{g as f}from"./companyLogos-DKj1kb25.js";import{f as g,a as p,g as b}from"./index-Da-XnBm0.js";import{M as j}from"./index-CL1DZVqy.js";import"./vendor-supabase-B4f4CcZD.js";import"./vendor-charts-CPng-d0O.js";import"./whatsapp-bfrw3Kdz.js";const v=(s=8)=>n({queryKey:["publicCompanies",s],queryFn:async()=>{const{data:t,error:i}=await x.from("companies").select(`
          id,
          name,
          description,
          logo_url,
          website,
          industry,
          headquarters,
          total_jobs,
          is_verified
        `).eq("status","verified").eq("is_verified",!0).order("total_jobs",{ascending:!1}).limit(s);if(i)throw i;return t||[]},staleTime:30*60*1e3,gcTime:2*60*60*1e3,refetchOnWindowFocus:!1,refetchInterval:20*60*1e3,retry:2,retryDelay:t=>Math.min(1e3*2**t,5e3)}),w=()=>{const s=n({queryKey:["featuredJobs",6],queryFn:()=>c.fetchFeaturedJobs(6),staleTime:18e5,gcTime:36e5,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1}),{data:t,isLoading:i,error:r}=v(8),a=u(),l=s.isLoading||i||a.isLoading,m=s.error||r||a.error;return{featuredJobs:s.data||[],companies:t||[],categories:a.data||[],isLoading:l,error:m}};function M(){const{companies:s,isLoading:t,error:i}=w();return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"container",children:[e.jsxs("div",{className:"grid grid-cols-1 pb-8 text-center",children:[e.jsx("h3",{className:"mb-4 md:text-[26px] md:leading-normal text-2xl leading-normal font-semibold",children:"Trusted by Leading Companies"}),e.jsx("p",{className:"text-slate-400 max-w-xl mx-auto",children:"Join forward-thinking companies that have transformed their hiring process with our smart platform. See real results and time savings."})]}),e.jsx("div",{className:"grid lg:grid-cols-4 md:grid-cols-2 grid-cols-1 mt-8 gap-[30px]",children:t?Array(8).fill(0).map((r,a)=>e.jsxs("div",{className:"group relative p-6 rounded-md shadow-sm shadow-gray-200 dark:shadow-gray-700 mt-6",children:[e.jsx("div",{className:"size-14 flex items-center justify-center bg-white dark:bg-slate-900 shadow-md shadow-gray-200 dark:shadow-gray-700 rounded-md relative -mt-12",children:e.jsx(o,{className:"size-8 rounded"})}),e.jsxs("div",{className:"mt-4 space-y-2",children:[e.jsx(o,{className:"h-6 w-32"}),e.jsx(o,{className:"h-4 w-full"}),e.jsx(o,{className:"h-4 w-3/4"})]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100 dark:border-gray-700 flex justify-between",children:[e.jsx(o,{className:"h-4 w-20"}),e.jsx(o,{className:"h-4 w-16"})]})]},a)):i||!s||s.length===0?e.jsx("div",{className:"col-span-full text-center py-8",children:e.jsx("p",{className:"text-slate-400",children:i?"Unable to load companies at this time.":"No companies available right now."})}):s==null?void 0:s.map(r=>e.jsxs(d,{to:`/employer-detail/${r.id}`,className:"group relative flex flex-col h-full p-6 rounded-md shadow-sm shadow-gray-200 dark:shadow-gray-700 mt-6 border-t-4 border-emerald-500 hover:scale-[1.02] hover:shadow-lg transition-all duration-300 cursor-pointer active:scale-[0.98]",children:[e.jsx("div",{className:"absolute top-2 right-4 bg-gradient-to-br from-purple-100 to-purple-200 dark:from-purple-900/40 dark:to-purple-800/40 px-4 py-2 rounded-full shadow-md",children:e.jsxs("span",{className:"text-purple-600 dark:text-purple-300 font-semibold text-sm whitespace-nowrap",children:[r.total_jobs||0," Job",r.total_jobs!==1?"s":""]})}),e.jsx("div",{className:"size-20 flex items-center justify-center bg-gradient-to-br from-emerald-50 to-white dark:from-emerald-900/20 dark:to-slate-900 shadow-md shadow-gray-200 dark:shadow-gray-700 rounded-md relative -mt-10",children:(()=>{var l;const a=f(r.logo_url);return a?e.jsx("img",{src:a,className:"size-12 object-contain",alt:r.name}):e.jsx("div",{className:"size-12 bg-emerald-100 dark:bg-emerald-900 rounded flex items-center justify-center text-emerald-600 font-semibold text-lg",children:((l=r.name)==null?void 0:l.charAt(0))||"?"})})()}),e.jsxs("div",{className:"mt-4 flex-1 flex flex-col space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-xl font-bold hover:text-emerald-600 transition-colors",children:r.name||"Company"}),r.is_verified&&e.jsx(g,{className:"size-5 text-emerald-600 flex-shrink-0"})]}),e.jsx("p",{className:"text-slate-400 line-clamp-2 flex-1",children:r.description||"Leading company in their industry"}),r.industry&&e.jsx(h,{variant:"secondary",className:"w-fit text-xs",children:r.industry})]}),e.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100 dark:border-gray-700",children:e.jsxs("span",{className:"text-slate-400 flex items-center text-sm",children:[e.jsx(p,{className:"me-1"})," ",r.headquarters||"Global"]})}),e.jsx("div",{className:"absolute bottom-4 right-4 opacity-0 group-hover:opacity-100 transform translate-x-2 group-hover:translate-x-0 transition-all duration-300",children:e.jsx(b,{className:"size-5 text-emerald-600"})})]},r.id))}),e.jsx("div",{className:"grid md:grid-cols-12 grid-cols-1 mt-6",children:e.jsx("div",{className:"md:col-span-12 text-center",children:e.jsxs(d,{to:"/employer-list",className:"inline-flex items-center font-semibold tracking-wide border align-middle transition text-base text-center relative border-none after:content-[''] after:absolute after:h-px after:w-0 after:end-0 after:bottom-0 after:start-0 after:transition-all after:duration-500 hover:after:w-full hover:after:end-auto text-slate-400 hover:text-emerald-600 after:bg-emerald-600 duration-500 ease-in-out",children:["See All Companies ",e.jsx(j,{className:"ms-1"})]})})})]})})}export{M as default};