import{a as e}from"./query-BtP_B6q9.js";import{n as t}from"./react-CdhQMFNz.js";import{k as n}from"./vendor-B2maTQLc.js";import{_ as r,d as i,s as a,u as o}from"./Logo-CWvlQZMc.js";import{o as s,t as c}from"./main-DV3J5_jb.js";var l=e();function u(){let{data:e,isLoading:u,isError:d}=c();return(0,l.jsx)(s,{children:(0,l.jsxs)(`div`,{className:`container-page py-10 lg:py-14`,children:[(0,l.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,l.jsx)(`h1`,{className:`text-2xl font-semibold tracking-[-0.02em] text-text-primary sm:text-3xl`,children:`Categories`}),(0,l.jsx)(`p`,{className:`mt-2 text-text-secondary`,children:`Browse the marketplace by what a name is for.`})]}),u?(0,l.jsx)(a,{label:`Loading categories`}):d?(0,l.jsx)(r,{tone:`error`,title:`Could not load categories`,className:`mt-8`,children:`Refresh the page to try again.`}):e===void 0||e.length===0?(0,l.jsx)(o,{className:`mt-8`,icon:(0,l.jsx)(n,{className:`size-5`}),title:`No categories yet`,description:`Categories appear here once an administrator sets them up.`}):(0,l.jsx)(`div`,{className:`mt-8 grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:e.map(e=>(0,l.jsx)(t,{to:`/domains?category=${e.slug}`,children:(0,l.jsxs)(i,{interactive:!0,className:`h-full p-5`,children:[(0,l.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,l.jsx)(`h2`,{className:`text-base font-semibold text-text-primary`,children:e.name}),(0,l.jsx)(`span`,{"data-numeric":!0,className:`shrink-0 text-sm text-text-muted`,children:e.listings_count})]}),e.description!==null&&(0,l.jsx)(`p`,{className:`mt-2 text-sm text-text-secondary`,children:e.description}),e.children!==void 0&&e.children.length>0&&(0,l.jsx)(`p`,{className:`mt-3 text-xs text-text-muted`,children:e.children.map(e=>e.name).join(` · `)})]})},e.slug))})]})})}export{u as CategoriesPage};
//# sourceMappingURL=CategoriesPage-CFfT4-a5.js.map