1import{u as b,r as m,aF as N,ac as f,j as e,ad as y,N as x,B as r,ah as w,U as k,aJ as A,e as P,O as l,bK as u}from"./index-BUR_l9d0.js";import{A as C}from"./ActivityPost-D-DPCtzO.js";import"./textarea-BXzZpztK.js";import"./select-B7hLupPU.js";import"./circle-check-BXmL1T8w.js";function L(){const{username:a}=b(),[n,h]=m.useState("all"),[o,c]=m.useState(1),{data:t,isLoading:p,isError:j}=N(n,o,a);f({title:`Activities by ${a} â Flightsim.to`,description:`Browse activity posts by ${a} on Flightsim.to.`});const d=(t==null?void 0:t.data)??[],i=t==null?void 0:t.pagination,g=s=>{h(s),c(1)};return e.jsxs(y,{children:[e.jsxs("section",{className:"relative bg-gradient-to-br from-primary/10 via-background to-accent/10 py-12",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[e.jsx("div",{className:"absolute top-20 left-10 w-72 h-72 bg-primary/5 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-10 right-20 w-96 h-96 bg-accent/5 rounded-full blur-3xl"})]}),e.jsxs("div",{className:"container mx-auto px-4 relative",children:[e.jsx(x,{to:"/activities",children:e.jsxs(r,{variant:"ghost",size:"sm",className:"mb-6",children:[e.jsx(w,{className:"h-4 w-4 mr-2"}),"Back to Activities"]})}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-3 rounded-full bg-primary/10",children:e.jsx(k,{className:"h-8 w-8 text-primary"})}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl md:text-3xl font-bold",children:["Activities by ",a]}),e.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"All posts from this creator"})]})]}),e.jsx(x,{to:`/profile/${a}`,children:e.jsx(r,{variant:"outline",size:"sm",children:"View Full Profile"})})]})]})]}),e.jsx("div",{className:"border-b border-border bg-background/80 sticky top-16 z-20 backdrop-blur-sm",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsx("nav",{className:"flex items-center gap-2 overflow-x-auto py-3 scrollbar-none",children:A.map(s=>e.jsx("button",{onClick:()=>g(s.value),className:P("shrink-0 rounded-full px-4 py-1.5 text-sm font-medium transition-colors",n===s.value?"bg-primary text-primary-foreground shadow-sm":"bg-secondary text-muted-foreground hover:text-foreground"),children:s.label},s.value))})})}),e.jsxs("div",{className:"container mx-auto px-4 py-8 pb-16",children:[p?e.jsx("div",{className:"columns-1 gap-4 lg:columns-2 2xl:columns-3 [&>*]:mb-4",children:Array.from({length:6}).map((s,v)=>e.jsxs("div",{className:"break-inside-avoid overflow-hidden rounded-xl border border-border p-5 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(l,{className:"h-10 w-10 rounded-full"}),e.jsxs("div",{className:"space-y-1.5 flex-1",children:[e.jsx(l,{className:"h-4 w-32"}),e.jsx(l,{className:"h-3 w-20"})]})]}),e.jsx(l,{className:"h-4 w-3/4"}),e.jsx(l,{className:"aspect-video w-full"})]},v))}):j?e.jsxs("div",{className:"text-center py-16 text-muted-foreground",children:[e.jsx(u,{className:"h-12 w-12 mx-auto mb-3 opacity-40"}),e.jsx("p",{className:"text-lg font-medium",children:"Failed to load activities"}),e.jsx("p",{className:"text-sm mt-1",children:"Please try again later."})]}):d.length>0?e.jsx("div",{className:"columns-1 gap-4 lg:columns-2 2xl:columns-3 [&>*]:mb-4",children:d.map(s=>e.jsx("div",{className:"break-inside-avoid",children:e.jsx(C,{post:s})},s.id))}):e.jsxs("div",{className:"text-center py-16 text-muted-foreground",children:[e.jsx(u,{className:"h-12 w-12 mx-auto mb-3 opacity-40"}),e.jsxs("p",{className:"text-lg font-medium",children:["No posts by ",a," yet"]}),e.jsx("p",{className:"text-sm mt-1",children:"This user hasn't posted any activities."})]}),i&&i.totalPages>1&&e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-8",children:[e.jsx(r,{variant:"outline",size:"sm",disabled:o<=1,onClick:()=>c(s=>s-1),children:"Previous"}),e.jsxs("span",{className:"text-sm text-muted-foreground px-3",children:["Page ",i.page," of ",i.totalPages]}),e.jsx(r,{variant:"outline",size:"sm",disabled:o>=i.totalPages,onClick:()=>c(s=>s+1),children:"Next"})]})]})]})}export{L as default};
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.