import{az as h,j as t,I as f,T as d,aA as u}from"./index-BX768Frx.js";import{u as w}from"./useQuery-DHwdh6Ld.js";import{c as j,u as y,g as C,P as S}from"./paginated-table-BoD1fFcj.js";import{M as b}from"./main-B6XIaWoX.js";import"./useBaseQuery-DCSHiJ5h.js";import"./Table-CYzl-NNc.js";import"./useToggleState-DWs3jB3l.js";import"./select-fQyM9_P4.js";import"./empty-list-CHaQSvfG.js";function R({snapshotId:c,path:m,page:o,perPage:s,onPageChange:p}){const e=w({...h({snapshotId:c,path:m,page:o,perPage:s})}),n=j(),i=[n.accessor("name",{header:()=>"Filename",meta:{cellClassName:"w-1/3"},cell:({row:a})=>t.jsxs("div",{className:"flex gap-2",children:[t.jsx(f,{type:"exclamation-circle",className:"text-error",size:"md"}),t.jsx(d,{weight:"medium",size:"md",className:"text-primary leading-none break-all select-text",children:a.original.name})]})}),n.accessor("error",{header:()=>"Error",cell:({row:a})=>t.jsx(d,{weight:"normal",className:"text-secondary break-all select-text",children:a.original.error})})],r={pageIndex:o,pageSize:s},g=y({data:e.data?.items??[],rowCount:e.data?.total,columns:i,state:{pagination:r},getRowId:(a,l)=>`row-${l}`,enableMultiRowSelection:!1,onPaginationChange:a=>{const l=typeof a=="function"?a(r):a;p(l.pageIndex,l.pageSize)},manualPagination:!0,getCoreRowModel:C()}),x=e.data?e.data.total==1?"1 error":`${e.data.total} errors`:"Errors";return t.jsx(b,{title:x,children:t.jsx(S,{variant:"cards",query:e,table:g,ariaLabel:"Snapshot errors"})})}function F(){const{snapshotId:c}=u.useParams(),{path:m,page:o,per_page:s}=u.useSearch(),p=u.useNavigate(),e=(n,i)=>p({search:r=>({...r,page:r.per_page!==i?0:n,per_page:i})});return t.jsx(R,{snapshotId:c,path:m,page:o,perPage:s,onPageChange:e})}export{F as component};
