import{j as s}from"./query-Bw69rE6b.js";import{e as l,c as w,a2 as k,B as E,Q as R}from"./index-CoUu6FiM.js";import{E as m}from"./EmptyState-CgO0CCgi.js";import{R as v}from"./rotate-ccw-CDH4c_fo.js";function A({status:n,className:a,loadingBlocks:p=3,hideLoadingTitle:d,error:i,onRetry:o,errorTitle:h,emptyIcon:f,emptyTitle:u,emptyDescription:x,emptyActions:j}){if(n==="loading")return s.jsxs("div",{role:"status","aria-busy":"true","aria-live":"polite",className:w("space-y-3",a),children:[!d&&s.jsx(l,{className:"h-5 w-1/3"}),Array.from({length:Math.max(1,p)}).map((t,e)=>s.jsx(l,{shape:"block",className:"h-24 w-full"},e))]});if(n==="error"){const t=i instanceof R?i:null,e=i instanceof Error?i.message:"Something went wrong loading this view.",g=h??(t?`Request failed (${t.status})`:"Request failed"),r=t?t.detail:e,c=t?.hint;return s.jsx(m,{icon:k,title:g,description:c?s.jsxs("span",{children:[r,s.jsx("span",{className:"mt-1 block text-ink-dim",children:c})]}):r,actions:o?s.jsx(E,{variant:"secondary",size:"sm",leadingIcon:s.jsx(v,{className:"h-3.5 w-3.5"}),onClick:o,children:"Try again"}):void 0,className:a})}return s.jsx(m,{icon:f,title:u??"Nothing to show",description:x,actions:j,className:a})}export{A as R};
