PageSourceSearch

https://markrepo.com/assets/PublicCollectionView-T1_ibNlG.js

js markrepo.com collected 2026-09-24 14:48:03 UTC 11,328 bytes, 1 lines download raw bytes

1import{bC as P,p as f,t as m,q as r,j as e,B as i,ai as p,b1 as V,aA as N,z as v,E as y,ae as k,aG as S}from"./index-TyWYT1Li.js";import{S as o}from"./skeleton-D7i0LQ2T.js";import{B as d}from"./bookmark-BcnPTb7e.js";import{C as R}from"./copy-CIR4VuVd.js";import{E as M}from"./eye-BVoV297r.js";import{P as B}from"./plus-f0r-9mc0.js";function F(){const[,u]=P("/c/:slug"),x=u?.slug??"",{isAuthenticated:a}=f(),{data:s,isLoading:g,error:b}=m.publicCollections.getBySlug.useQuery({slug:x},{enabled:!!x}),n=m.bookmarks.create.useMutation({onSuccess:()=>r.success("Saved to your MarkRepo!"),onError:l=>r.error(`Failed to save: ${l.message}`)}),h=(l,c,t,j)=>{if(l.preventDefault(),l.stopPropagation(),!a){window.location.href=S();return}n.mutate({url:c,title:t,description:j??void 0})},w=()=>{navigator.clipboard.writeText(window.location.href),r.success("Link copied!")};if(g)return e.jsx("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:58",className:"min-h-screen bg-background",children:e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:59",className:"max-w-2xl mx-auto px-4 py-12",children:[e.jsx(o,{"data-loc":"client/src/pages/PublicCollectionView.tsx:60",className:"h-8 w-48 mb-2"}),e.jsx(o,{"data-loc":"client/src/pages/PublicCollectionView.tsx:61",className:"h-5 w-72 mb-8"}),e.jsx("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:62",className:"space-y-4",children:[1,2,3,4].map(l=>e.jsx("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:64",className:"p-4 rounded-xl border",children:e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:65",className:"flex gap-3",children:[e.jsx(o,{"data-loc":"client/src/pages/PublicCollectionView.tsx:66",className:"w-8 h-8 rounded-md flex-shrink-0"}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:67",className:"flex-1 space-y-2",children:[e.jsx(o,{"data-loc":"client/src/pages/PublicCollectionView.tsx:68",className:"h-5 w-3/4"}),e.jsx(o,{"data-loc":"client/src/pages/PublicCollectionView.tsx:69",className:"h-4 w-1/2"})]})]})},l))})]})});if(!s||b)return e.jsx("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:82",className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:83",className:"text-center px-4",children:[e.jsx("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:84",className:"text-5xl mb-4",children:"🔍"}),e.jsx("h1",{"data-loc":"client/src/pages/PublicCollectionView.tsx:85",className:"text-2xl font-bold mb-2",children:"Collection not found"}),e.jsx("p",{"data-loc":"client/src/pages/PublicCollectionView.tsx:86",className:"text-muted-foreground mb-6",children:"This collection may have been made private or deleted."}),e.jsx(i,{"data-loc":"client/src/pages/PublicCollectionView.tsx:89",asChild:!0,children:e.jsx("a",{"data-loc":"client/src/pages/PublicCollectionView.tsx:90",href:"/",children:"Go to MarkRepo"})})]})});const C=l=>{try{return new URL(l).hostname.replace("www.","")}catch{return l}};return e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:102",className:"min-h-screen bg-background",children:[e.jsx("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:104",className:"border-b bg-card/50 backdrop-blur-sm sticky top-0 z-10",children:e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:105",className:"max-w-2xl mx-auto px-4 py-3 flex items-center justify-between",children:[e.jsxs("a",{"data-loc":"client/src/pages/PublicCollectionView.tsx:106",href:"/",className:"flex items-center gap-2 text-sm font-semibold hover:opacity-80 transition-opacity",children:[e.jsx("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:107",className:"w-6 h-6 rounded-md bg-primary flex items-center justify-center",children:e.jsx(d,{"data-loc":"client/src/pages/PublicCollectionView.tsx:108",className:"w-3.5 h-3.5 text-primary-foreground"})}),"MarkRepo"]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:112",className:"flex items-center gap-2",children:[e.jsxs(i,{"data-loc":"client/src/pages/PublicCollectionView.tsx:113",size:"sm",variant:"ghost",className:"h-8 px-3 text-xs",onClick:w,children:[e.jsx(R,{"data-loc":"client/src/pages/PublicCollectionView.tsx:114",className:"w-3 h-3 mr-1"}),"Copy Link"]}),e.jsx(i,{"data-loc":"client/src/pages/PublicCollectionView.tsx:117",size:"sm",asChild:!0,className:"h-8 px-3 text-xs",children:e.jsxs("a",{"data-loc":"client/src/pages/PublicCollectionView.tsx:118",href:"/register",children:["Save to MarkRepo",e.jsx(p,{"data-loc":"client/src/pages/PublicCollectionView.tsx:120",className:"w-3 h-3 ml-1"})]})})]})]})}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:128",className:"max-w-2xl mx-auto px-4 py-10",children:[e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:129",className:"mb-8",children:[e.jsx("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:130",className:"text-4xl mb-3",children:s.icon}),e.jsx("h1",{"data-loc":"client/src/pages/PublicCollectionView.tsx:131",className:"text-3xl font-bold tracking-tight mb-2",children:s.title}),s.description&&e.jsx("p",{"data-loc":"client/src/pages/PublicCollectionView.tsx:133",className:"text-muted-foreground text-base mb-4 leading-relaxed",children:s.description}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:137",className:"flex items-center gap-4 text-sm text-muted-foreground flex-wrap",children:[e.jsxs("span",{"data-loc":"client/src/pages/PublicCollectionView.tsx:138",className:"flex items-center gap-1.5",children:[e.jsx(V,{"data-loc":"client/src/pages/PublicCollectionView.tsx:139",className:"w-4 h-4"}),s.ownerName??"Anonymous"]}),e.jsxs("span",{"data-loc":"client/src/pages/PublicCollectionView.tsx:142",className:"flex items-center gap-1.5",children:[e.jsx(M,{"data-loc":"client/src/pages/PublicCollectionView.tsx:143",className:"w-4 h-4"}
1),s.viewCount.toLocaleString()," views"]}),e.jsxs("span",{"data-loc":"client/src/pages/PublicCollectionView.tsx:146",className:"flex items-center gap-1.5",children:[e.jsx(N,{"data-loc":"client/src/pages/PublicCollectionView.tsx:147",className:"w-4 h-4"}),s.items.length," bookmarks"]})]})]}),s.items.length===0?e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:155",className:"text-center py-12 text-muted-foreground",children:[e.jsx(d,{"data-loc":"client/src/pages/PublicCollectionView.tsx:156",className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{"data-loc":"client/src/pages/PublicCollectionView.tsx:157",children:"No bookmarks in this collection yet."})]}):e.jsx("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:160",className:"space-y-3",children:s.items.map((l,c)=>e.jsxs("a",{"data-loc":"client/src/pages/PublicCollectionView.tsx:162",href:l.url,target:"_blank",rel:"noopener noreferrer",className:"group flex items-start gap-4 p-4 rounded-xl border bg-card hover:shadow-md hover:-translate-y-0.5 transition-all duration-200 no-underline",children:[e.jsx("span",{"data-loc":"client/src/pages/PublicCollectionView.tsx:170",className:"text-2xl font-bold text-muted-foreground/20 leading-none flex-shrink-0 w-8 text-right mt-0.5",children:String(c+1).padStart(2,"0")}),e.jsx("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:175",className:"flex-shrink-0 mt-0.5",children:l.faviconUrl?e.jsx("img",{"data-loc":"client/src/pages/PublicCollectionView.tsx:177",src:l.faviconUrl,alt:"",className:"w-8 h-8 rounded-md object-contain bg-muted p-0.5",onError:t=>{t.target.style.display="none"}}):e.jsx("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:184",className:"w-8 h-8 rounded-md bg-muted flex items-center justify-center",children:e.jsx(d,{"data-loc":"client/src/pages/PublicCollectionView.tsx:185",className:"w-4 h-4 text-muted-foreground"})})}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:190",className:"flex-1 min-w-0",children:[e.jsx("h3",{"data-loc":"client/src/pages/PublicCollectionView.tsx:191",className:"font-semibold text-foreground text-sm leading-snug mb-1 line-clamp-2 group-hover:text-primary transition-colors",children:l.title}),e.jsx("p",{"data-loc":"client/src/pages/PublicCollectionView.tsx:194",className:"text-xs text-muted-foreground mb-1.5",children:C(l.url)}),l.aiSummary&&e.jsx("p",{"data-loc":"client/src/pages/PublicCollectionView.tsx:196",className:"text-xs text-muted-foreground/80 line-clamp-2 italic mb-2",children:l.aiSummary}),l.description&&!l.aiSummary&&e.jsx("p",{"data-loc":"client/src/pages/PublicCollectionView.tsx:201",className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:l.description}),l.tags&&l.tags.length>0&&e.jsx("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:206",className:"flex flex-wrap gap-1",children:l.tags.slice(0,4).map(t=>e.jsx(v,{"data-loc":"client/src/pages/PublicCollectionView.tsx:208",variant:"secondary",className:"text-xs py-0 px-1.5",children:t},t))})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:216",className:"flex flex-col items-center gap-2 flex-shrink-0",children:[e.jsx(y,{"data-loc":"client/src/pages/PublicCollectionView.tsx:217",className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"}),e.jsx("button",{"data-loc":"client/src/pages/PublicCollectionView.tsx:218",onClick:t=>h(t,l.url,l.title,l.description),title:a?"Save to my MarkRepo":"Sign in to save",className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded-md bg-primary/10 hover:bg-primary/20 text-primary border border-primary/20",children:e.jsx(B,{"data-loc":"client/src/pages/PublicCollectionView.tsx:223",className:"w-3.5 h-3.5"})})]})]},l.id))}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:232",className:"mt-12 p-6 rounded-2xl bg-gradient-to-br from-primary/10 to-primary/5 border border-primary/20 text-center",children:[e.jsx("div",{"data-loc":"client/src/pages/PublicCollectionView.tsx:233",className:"text-2xl mb-2",children:"🔖"}),e.jsx("h3",{"data-loc":"client/src/pages/PublicCollectionView.tsx:234",className:"font-semibold text-lg mb-1",children:a?"Save this entire collection to your MarkRepo":"Build your own knowledge library"}),e.jsx("p",{"data-loc":"client/src/pages/PublicCollectionView.tsx:237",className:"text-sm text-muted-foreground mb-4",children:a?"Hover any bookmark above and click + to save it, or save all at once.":"MarkRepo uses AI to auto-tag, summarize, and resurface everything you save. Free to start."}),a?e.jsxs(i,{"data-loc":"client/src/pages/PublicCollectionView.tsx:243",onClick:()=>{const l=s?.items??[];let c=0;l.forEach(t=>
1{n.mutate({url:t.url,title:t.title,description:t.description??void 0}),c++}),r.success(`Saving all ${c} bookmarks to your MarkRepo...`)},disabled:n.isPending,children:[e.jsx(k,{"data-loc":"client/src/pages/PublicCollectionView.tsx:259",className:"w-4 h-4 mr-2"}),"Save all ",s?.items.length??0," bookmarks"]}):e.jsx(i,{"data-loc":"client/src/pages/PublicCollectionView.tsx:263",asChild:!0,children:e.jsxs("a",{"data-loc":"client/src/pages/PublicCollectionView.tsx:264",href:"/register",children:["Get started free",e.jsx(p,{"data-loc":"client/src/pages/PublicCollectionView.tsx:266",className:"w-4 h-4 ml-2"})]})})]})]})]})}export{F 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.