1import{u as y,r as m,j as s,B as n}from"./index-DESPVSwC.js";/* empty css */import{a as v,P as E,b as g,e as P}from"./share-schema-dr5sSL3x.js";import{A as C,a as b}from"./alert-DXb383OL.js";import{E as N,a as I,d as M,b as S,c as k,e as w}from"./empty-Dy5TB5gC.js";import{S as A}from"./skeleton-D-MVMyfO.js";import{P as p,a as O}from"./photo-grid-y9HYveUO.js";import{I as T}from"./image-B-afoOGN.js";import"./badge-C7eR8DHK.js";import"./globe-DG93q3Fw.js";import"./spinner-5AWr5i3i.js";import"./image-off-BEFEAxJQ.js";import"./upload-B7_3KU3u.js";const i=24,B=["a","b","c","d","e","f","g","h","i","j"];function D(){const r=y(),[t,c]=m.useState(0),{data:a,isLoading:h,isError:u,error:x}=v({skipCount:t*i,maxResultCount:i}),j=a?.items??[],o=a?.totalCount??0,l=o>0?Math.ceil(o/i)-1:0;m.useEffect(()=>{a&&t>l&&c(l)},[a,t,l]);const f=(e,d)=>r({to:"/photos/$collectionId",params:{collectionId:e},search:{image:d}});return s.jsxs(E,{children:[s.jsx(g,{eyebrow:"Photos",title:"My contributions",description:"Every photo you have uploaded, newest first.",actions:s.jsx(n,{variant:"outline",onClick:()=>r({to:"/photos"}),children:"All collections"})}),u?s.jsx(C,{variant:"destructive",children:s.jsx(b,{children:P(x)})}):h?s.jsx("div",{className:p,children:B.map(e=>s.jsx(A,{className:"aspect-square w-full rounded-lg"},e))}):o===0?s.jsxs(N,{children:[s.jsxs(I,{children:[s.jsx(M,{variant:"icon",children:s.jsx(T,{})}),s.jsx(S,{children:"No photos yet"}),s.jsx(k,{children:"Photos you upload to any collection show up here."})]}),s.jsx(w,{children:s.jsx(n,{onClick:()=>r({to:"/photos"}),children:"Browse collections"})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:p,children:j.map(e=>s.jsx(O,{image:e,onOpen:d=>e.collectionId?f(e.collectionId,d):void 0},e.id))}),o>i?s.jsxs("div",{className:"flex items-center justify-between text-muted-foreground text-sm",children:[s.jsxs("span",{children:[t*i+1,"â",Math.min((t+1)*i,o)," of"," ",o]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(n,{variant:"outline",size:"sm",disabled:t===0,onClick:()=>c(e=>e-1),children:"Previous"}),s.jsx(n,{variant:"outline",size:"sm",disabled:(t+1)*i>=o,onClick:()=>c(e=>e+1),children:"Next"})]})]}):null]})]})}function V(){return s.jsx(D,{})}export{V as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.