1import{u as f,j as e}from"./vendor-query-CKmScdIa.js";import{M as N,L as m,B as x,U as v,C as b,b as u}from"./index-YjeYizwY.js";import{T as y,a as w,b as h,c as p}from"./tabs-CXzKlrHX.js";import{T}from"./TrustBadge-Cbx-rNv7.js";import{u as F}from"./use-seo-BQZ88Lxf.js";import{L as k,bg as g,S as A,ae as S,be as C,a6 as B}from"./vendor-icons-GsmB1pjl.js";import"./vendor-ui-C0HqfHwP.js";import"./vendor-algo-BPnWE1Cr.js";function U(s,r){const a=s/Math.pow(10,r);return a>=1?a.toFixed(2):a.toFixed(Math.min(r,6))}function j({nft:s,label:r}){return e.jsx(m,{href:`/nft/${s.id}`,children:e.jsxs(b,{className:"overflow-hidden cursor-pointer hover:ring-2 hover:ring-primary/30 transition-all","data-testid":`card-creator-nft-${s.id}`,children:[e.jsxs("div",{className:"aspect-square overflow-hidden rounded-t-md bg-muted relative",children:[s.imageUrl?e.jsx("img",{src:s.imageUrl.startsWith("ipfs://")?s.imageUrl.replace("ipfs://","https://ipfs.io/ipfs/"):s.imageUrl,alt:s.name,className:"w-full h-full object-cover",onError:a=>{const i=a.target;i.style.display="none";const d=i.parentElement?.querySelector("[data-fallback]");d&&(d.style.display="flex")}}):null,e.jsx("div",{"data-fallback":"",className:"absolute inset-0 items-center justify-center flex-col gap-2",style:{display:s.imageUrl?"none":"flex"},children:e.jsx(B,{className:"w-12 h-12 text-muted-foreground/30"})})]}),e.jsxs("div",{className:"p-3 space-y-1",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h3",{className:"font-semibold text-sm truncate",children:s.name}),s.isSold?e.jsx(u,{variant:"outline",className:"shrink-0 text-xs",children:"Sold"}):r==="collected"?e.jsx(u,{variant:"secondary",className:"shrink-0 text-xs",children:"Owned"}):e.jsxs(u,{variant:"secondary",className:"shrink-0 text-xs",children:[U(s.priceAmount,s.priceTokenDecimals||6)," ",s.priceTokenUnitName||"ALGO"]})]}),s.unitName&&e.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["#",s.unitName]}),s.description&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["ASA ID: ",s.assetId]})]})]})})}function V(){const[,s]=N("/nft/creator/:userId"),r=s?.userId,{data:a,isLoading:i,error:d}=f({queryKey:["/api/nfts/creator",r],queryFn:async()=>{const t=await fetch(`/api/nfts/creator/${r}`);if(!t.ok)throw new Error("Failed to load creator");return t.json()},enabled:!!r});if(F({title:a?.creator?.username?`${a.creator.username} - NFT Creator | AAA Fair Benefit`:"NFT Creator | AAA Fair Benefit",description:a?.creator?.bio||"View NFTs from this creator on AAA Fair Benefit"}),i)return e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(k,{className:"w-8 h-8 animate-spin text-muted-foreground"})});if(d||!a)return e.jsxs("div",{className:"container mx-auto px-4 py-12 text-center",children:[e.jsx("p",{className:"text-muted-foreground",children:"Creator not found."}),e.jsx(m,{href:"/nfts",children:e.jsxs(x,{variant:"outline",className:"mt-4",children:[e.jsx(g,{className:"w-4 h-4 mr-2"})," Back to NFT Market"]})})]});const{creator:l,forSale:n,sold:o,collected:c}=a;return e.jsxs("div",{className:"container mx-auto px-4 py-6 max-w-5xl",children:[e.jsx(m,{href:"/nfts",children:e.jsxs(x,{variant:"ghost",size:"sm",className:"mb-4","data-testid":"button-back-nfts",children:[e.jsx(g,{className:"w-4 h-4 mr-2"})," NFT Market"]})}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsx(v,{user:l,className:"w-16 h-16"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("h1",{className:"text-2xl font-bold","data-testid":"text-creator-name",children:["@",l.username||"Unknown"]}),e.jsx(T,{userId:l.id,size:"sm"})]}),l.bio&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1 max-w-md","data-testid":"text-creator-bio",children:l.bio}),e.jsxs("div",{className:"flex gap-4 mt-2 text-sm text-muted-foreground",children:[e.jsxs("span",{"data-testid":"text-for-sale-count",children:[e.jsx(A,{className:"w-4 h-4 inline mr-1"}),n.length," for sale"]}),e.jsxs("span",{"data-testid":"text-sold-count",children:[e.jsx(S,{className:"w-4 h-4 inline mr-1"}),o.length," sold"]}),e.jsxs("span",{"data-testid":"text-collected-count",children:[e.jsx(C,{className:"w-4 h-4 inline mr-1"}),c.length," collected"]})]}),e.jsx(m,{href:`/u/${l.username}`,children:e.jsx(x,{variant:"outline",size:"sm",className:"mt-2","data-testid":"button-view-profile",children:"View Full Profile"})})]})]}),e.jsxs(y,{defaultValue:"forSale","data-testid":"tabs-creator-nfts",children:[e.jsxs(w,{className:"mb-4",children:[e.jsxs(h,{value:"forSale","data-testid":"tab-for-sale",children:["For Sale (",n.length,")"]}),e.jsxs(h,{value:"sold","data-testid":"tab-sold",children:["Sold (",o.length,")"]}),e.jsxs(h,{value:"collected","data-testid":"tab-collected",children:["Collected (",c.length,")"]})]}),e.jsx(p,{value:"forSale",children:n.length===0?e.jsx("p",{className:"text-center text-muted-foreground py-12",children:"No NFTs currently for sale."}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:n.map(t=>e.jsx(j,{nft:t},t.id))})}),e.jsx(p,{value:"sold",children:o.length===0?e.jsx("p",{className:"text-center text-muted-foreground py-12",children:"No sold NFTs yet."}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(t=>e.jsx(j,{nft:t},t.id))})}),e.jsx(p,{value:"collected",children:c.length===0?e.jsx("p",{className:"text-center text-muted-foreground py-12",children:"No collected NFTs yet."}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:c.map(t=>e.jsx(j,{nft:t,label:"collected"},t.id))})})]})]})}export{V 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.