import{j as e}from"./vendor-radix-DNp60FuA.js";import{L as l}from"./vendor-react-DL0tRKZA.js";import{u as n}from"./vendor-query-CKQAY9LX.js";import{j as c}from"./supabase-queries-C4jwBnTx.js";import{s as x,k as p}from"./index-DbhEjV5W.js";import{u}from"./useJobs-BcJy3TPh.js";import{S as o}from"./skeleton-Dsa0O-T7.js";import{g}from"./companyLogos-DKj1kb25.js";import{f,a as b,g as h}from"./index-BxeYe70z.js";import{M as j}from"./index-D0VLSXYk.js";import"./vendor-supabase-B4f4CcZD.js";import"./vendor-charts-CPng-d0O.js";import"./whatsapp-bfrw3Kdz.js";const y=(s=8)=>n({queryKey:["publicCompanies",s],queryFn:async()=>{const{data:a,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 a||[]},staleTime:30*60*1e3,gcTime:2*60*60*1e3,refetchOnWindowFocus:!1,refetchInterval:20*60*1e3,retry:2,retryDelay:a=>Math.min(1e3*2**a,5e3)}),v=()=>{const s=n({queryKey:["featuredJobs",6],queryFn:()=>c.fetchFeaturedJobs(6),staleTime:18e5,gcTime:36e5,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1}),{data:a,isLoading:i,error:r}=y(8),t=u(),d=s.isLoading||i||t.isLoading,m=s.error||r||t.error;return{featuredJobs:s.data||[],companies:a||[],categories:t.data||[],isLoading:d,error:m}};function M(){const{companies:s,isLoading:a,error:i}=v();return 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 bg-gradient-to-r from-foreground via-primary to-accent bg-clip-text text-transparent",children:"Trusted by Leading Companies"}),e.jsx("p",{className:"text-muted-foreground 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:a?Array(8).fill(0).map((r,t)=>e.jsxs("div",{className:"group relative p-6 rounded-xl bg-card/40 backdrop-blur-sm border border-border/50 mt-6",children:[e.jsx("div",{className:"size-14 flex items-center justify-center bg-gradient-to-br from-primary/20 to-accent/10 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-border/50 flex justify-between",children:[e.jsx(o,{className:"h-4 w-20"}),e.jsx(o,{className:"h-4 w-16"})]})]},t)):i||!s||s.length===0?e.jsx("div",{className:"col-span-full text-center py-8",children:e.jsx("p",{className:"text-muted-foreground",children:i?"Unable to load companies at this time.":"No companies available right now."})}):s==null?void 0:s.map(r=>e.jsxs(l,{to:`/employer-detail/${r.id}`,className:"group relative flex flex-col h-full p-6 rounded-xl bg-card/40 backdrop-blur-sm border border-border/50 mt-6 hover:bg-card/60 hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 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-primary/20 to-accent/20 px-4 py-2 rounded-full border border-primary/30",children:e.jsxs("span",{className:"text-primary 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-primary/20 to-accent/10 border border-border/50 rounded-md relative -mt-10",children:(()=>{var d;const t=g(r.logo_url);return t?e.jsx("img",{src:t,className:"size-12 object-contain",alt:r.name}):e.jsx("div",{className:"size-12 bg-primary/20 rounded flex items-center justify-center text-primary font-semibold text-lg",children:((d=r.name)==null?void 0:d.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 text-foreground group-hover:text-primary transition-colors",children:r.name||"Company"}),r.is_verified&&e.jsx(f,{className:"size-5 text-primary flex-shrink-0"})]}),e.jsx("p",{className:"text-muted-foreground line-clamp-2 flex-1",children:r.description||"Leading company in their industry"}),r.industry&&e.jsx(p,{variant:"secondary",className:"w-fit text-xs bg-secondary/50 border border-border/50",children:r.industry})]}),e.jsx("div",{className:"mt-4 pt-4 border-t border-border/50",children:e.jsxs("span",{className:"text-muted-foreground flex items-center text-sm",children:[e.jsx(b,{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(h,{className:"size-5 text-primary"})})]},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(l,{to:"/employer-list",className:"inline-flex items-center gap-2 px-6 py-3 rounded-full bg-primary/10 border border-primary/30 text-primary font-semibold hover:bg-primary/20 hover:border-primary/50 transition-all duration-300",children:["See All Companies ",e.jsx(j,{className:"text-lg"})]})})})]})}export{M as default};