PageSourceSearch

https://markrepo.com/assets/PublicCollections-CHi1e7-j.js

js markrepo.com collected 2026-09-24 14:48:00 UTC 32,636 bytes, 6 lines download raw bytes

1import{c as se,r as i,t as C,q as P,j as e,bb as A,b2 as le,aq as T,at as M,aA as $,s as B,a9 as U,bf as z,B as b,aa as V,ab as _,ac as G,ak as u,w as k,z as te,E as I}from"./index-TyWYT1Li.js";import{T as q}from"./textarea-DWB9WQhV.js";import{S as w,a as y,b as S,c as L,d as f}from"./select-B4FmQHV2.js";import{S as H}from"./switch-BPR7jCEm.js";import{S as h}from"./skeleton-D7i0LQ2T.js";import{D as ce}from"./DashboardLayout-jIaPHD0c.js";import{S as ae}from"./share-2-DHvUQJ99.js";import{P as ie}from"./plus-f0r-9mc0.js";import{S as Q}from"./star-DLRP7lm0.js";import{L as oe}from"./layout-grid-CSUEcBHz.js";import{E as W}from"./eye-BVoV297r.js";import{C as ne}from"./copy-CIR4VuVd.js";import{T as re}from"./trash-2-B25EQVPW.js";import{P as de}from"./pencil-DogqdzOP.js";import{f as xe}from"./formatDistanceToNow-0UJJWKmP.js";import"./index-BdQq_4o_.js";import"./chevron-up-qFCEkldH.js";import"./sheet-DUtDQodb.js";import"./layout-dashboard-CIJQwB0D.js";import"./sticky-note-DovQ-sw5.js";import"./wand-sparkles-bSD7UF_L.js";import"./trending-up-D-woPvjh.js";import"./shield-alert-vW181FpG.js";import"./activity-CVtRffst.js";import"./en-US-DL7QEam1.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const ue=se("ListFilter",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),J=["🔖","📚","🧠","🎯","💡","🚀","🌐","🔬","🎨","💼","⚡","🌟"],K=["All Professions","Healthcare","Legal","Technology","Finance","Education","Design","Marketing","Research","Engineering","Business"],X=["All Categories","Tools","Research","News","Learning","Reference","Inspiration","Templates","Community"],Y={Healthcare:"bg-rose-100 text-rose-700 dark:bg-rose-900/30 dark:text-rose-300",Legal:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",Technology:"bg-sky-100 text-sky-700 dark:bg-sky-900/30 dark:text-sky-300",Finance:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300",Education:"bg-teal-100 text-teal-700 dark:bg-teal-900/30 dark:text-teal-300",Design:"bg-pink-100 text-pink-700 dark:bg-pink-900/30 dark:text-pink-300",Marketing:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-300",Research:"bg-violet-100 text-violet-700 dark:bg-violet-900/30 dark:text-violet-300",Engineering:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-300",Business:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300"};function ge({collection:s,onUpdated:r}){const[c,d]=i.useState(!1),[a,g]=i.useState(s.title),[m,p]=i.useState(s.description??""),[o,l]=i.useState(s.shareableLink??""),[x,v]=i.useState(s.icon),[N,E]=i.useState(s.isPublic),[j,n]=i.useState(s.profession??""),[D,Z]=i.useState(s.category??""),[be,he]=i.useState(""),ee=C.useUtils(),F=C.publicCollections.update.useMutation({onSuccess:()=>{P.success("Collection updated!"),d(!1),ee.publicCollections.getMine.invalidate(),r()},onError:t=>P.error(t.message)});return e.jsxs(U,{"data-loc":"client/src/pages/PublicCollections.tsx:133",open:c,onOpenChange:d,children:[e.jsx(z,{"data-loc":"client/src/pages/PublicCollections.tsx:134",asChild:!0,children:e.jsxs(b,{"data-loc":"client/src/pages/PublicCollections.tsx:135",size:"sm",variant:"outline",className:"h-8 px-3 text-xs gap-1",children:[e.jsx(de,{"data-loc":"client/src/pages/PublicCollections.tsx:136",className:"w-3 h-3"}),"Edit"]})}),e.jsxs(V,{"data-loc":"client/src/pages/PublicCollections.tsx:140",className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsx(_,{"data-loc":"client/src/pages/PublicCollections.tsx:141",children:e.jsx(G,{"data-loc":"client/src/pages/PublicCollections.tsx:142",children:"Edit Collection"})}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:144",className:"space-y-4 pt-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:146",children:[e.jsx(u,{"data-loc":"client/src/pages/PublicCollections.tsx:147",className:"text-sm font-medium mb-2 block",children:"Icon"}),e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:148",className:"flex flex-wrap gap-2",children:J.map(t=>e.jsx("button",{"data-loc":"client/src/pages/PublicCollections.tsx:150",onClick:()=>v(t),className:`text-xl w-9 h-9 rounded-md border-2 transition-colors ${x===t?"border-primary bg-primary/10":"border-transparent hover:border-muted-foreground
6/30"}`,children:t},t))})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:165",children:[e.jsxs(u,{"data-loc":"client/src/pages/PublicCollections.tsx:166",htmlFor:"edit-col-title",className:"text-sm font-medium mb-1.5 block",children:["Title ",e.jsx("span",{"data-loc":"client/src/pages/PublicCollections.tsx:167",className:"text-destructive",children:"*"})]}),e.jsx(k,{"data-loc":"client/src/pages/PublicCollections.tsx:169",id:"edit-col-title",placeholder:"e.g. Best AI Tools 2025",value:a,onChange:t=>g(t.target.value),maxLength:255,autoComplete:"off"})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:179",children:[e.jsx(u,{"data-loc":"client/src/pages/PublicCollections.tsx:180",htmlFor:"edit-col-desc",className:"text-sm font-medium mb-1.5 block",children:"Description"}),e.jsx(q,{"data-loc":"client/src/pages/PublicCollections.tsx:181",id:"edit-col-desc",placeholder:"What is this collection about?",value:m,onChange:t=>p(t.target.value),rows:3,maxLength:2e3})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:191",children:[e.jsxs(u,{"data-loc":"client/src/pages/PublicCollections.tsx:192",htmlFor:"edit-col-link",className:"text-sm font-medium mb-1.5 block",children:["Shareable Link ",e.jsx("span",{"data-loc":"client/src/pages/PublicCollections.tsx:193",className:"text-muted-foreground font-normal",children:"(optional)"})]}),e.jsx(k,{"data-loc":"client/src/pages/PublicCollections.tsx:195",id:"edit-col-link",type:"url",placeholder:"https://notion.so/my-collection or any external URL",value:o,onChange:t=>l(t.target.value),maxLength:512}),e.jsx("p",{"data-loc":"client/src/pages/PublicCollections.tsx:203",className:"text-xs text-muted-foreground mt-1",children:"Link to a Notion page, Google Doc, or any external resource."})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:207",className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:208",children:[e.jsx(u,{"data-loc":"client/src/pages/PublicCollections.tsx:209",className:"text-sm font-medium mb-1.5 block",children:"Profession"}),e.jsxs(w,{"data-loc":"client/src/pages/PublicCollections.tsx:210",value:j||"none",onValueChange:t=>n(t==="none"?"":t),children:[e.jsx(y,{"data-loc":"client/src/pages/PublicCollections.tsx:211",className:"h-9 text-sm",children:e.jsx(S,{"data-loc":"client/src/pages/PublicCollections.tsx:212",placeholder:"Select profession"})}),e.jsxs(L,{"data-loc":"client/src/pages/PublicCollections.tsx:214",children:[e.jsx(f,{"data-loc":"client/src/pages/PublicCollections.tsx:215",value:"none",children:"None"}),K.slice(1).map(t=>e.jsx(f,{"data-loc":"client/src/pages/PublicCollections.tsx:217",value:t,children:t},t))]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:222",children:[e.jsx(u,{"data-loc":"client/src/pages/PublicCollections.tsx:223",className:"text-sm font-medium mb-1.5 block",children:"Category"}),e.jsxs(w,{"data-loc":"client/src/pages/PublicCollections.tsx:224",value:D||"none",onValueChange:t=>Z(t==="none"?"":t),children:[e.jsx(y,{"data-loc":"client/src/pages/PublicCollections.tsx:225",className:"h-9 text-sm",children:e.jsx(S,{"data-loc":"client/src/pages/PublicCollections.tsx:226",placeholder:"Select category"})}),e.jsxs(L,{"data-loc":"client/src/pages/PublicCollections.tsx:228",children:[e.jsx(f,{"data-loc":"client/src/pages/PublicCollections.tsx:229",value:"none",children:"None"}),X.slice(1).map(t=>e.jsx(f,{"data-loc":"client/src/pages/PublicCollections.tsx:231",value:t,children:t},t))]})]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:239",className:"flex items-center justify-between p-3 rounded-lg bg-muted/50 border",children:[e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:240",children:[e.jsx(u,{"data-loc":"client/src/pages/PublicCollections.tsx:241",htmlFor:"edit-col-public",className:"font-medium",children:"Make Public"}),e.jsx("p",{"data-loc":"client/src/pages/PublicCollections.tsx:242",className:"text-xs text-muted-foreground mt-0.5",children:"Anyone with the link can view this collection"})]}),e.jsx(H,{"data-loc":"client/src/pages/PublicCollections.tsx:246",id:"edit-col-public",checked:N,onCheckedChange:E})]}),e.jsx(b,{"data-loc":"client/src/pages/PublicCollections.tsx:253",className:"w-full",onClick:()=>F.mutate({id:s.id,title:a,description:m||void 0,shareableLink:o||null,icon:x,isPublic:N,profession:j||void 0,category:D||void 0}),disabled:!a.trim()||F.isPending,children:F.isPending?"Saving…":"Save Changes"})]})]})]})}function O({collection:s,onDelete:r,onUpdated:c}){const d=`${window.location.origin}/c/${s.slug}`,a=()=>{navigator.clipboard.writeText(d),P.success("Link copied to clipboard")};return e.jsx(T,{"data-loc":"client/src/pages/PublicCollections.tsx:308",className:"hover:shadow-md transition-all duration-200 hover:-translate-y-0.5",children:e.jsxs(M,{"data-loc":"client/src/pages/PublicCollections.tsx:309",className:"p-5",children:[e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:310",className:"flex items-start justify-between gap-3",children:e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:311",className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx("span",{"data-loc":"client/src/pages/PublicCollections.tsx:312",className:"text-2xl flex-shrink-0",children:s.icon}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:313",className:"flex-1 min-w-0",children:[e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:314",className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{"data-loc":"client/src/pages/PublicCollections.tsx:315",className:"font-semibold text-base truncate",children:s.title}),e.jsx(te,{"data-loc":"client/src/pages/PublicCollections.tsx:316",variant:s.isPublic?"default":"secondary",className:`text-xs py-0 px-2 flex-shrink-0 ${s.isPublic?"bg-emerald-500 hover:bg-emerald-600":""}`,children:s.isPublic?e.jsxs(e.Fragment,{children:[e.jsx($,{"data-loc":"client/src/pages/PublicCollections.tsx:321",className:"w-3 h-3 mr-1"}),"Public"]}):e.jsxs(e.Fragment,{children:[e.jsx(B,{"data-loc":"client/src/pages/PublicCollections.tsx:323",className:"w-3 h-3 mr-1"}),"Private"]})})]}),s.description&&e.jsx("p",{"data-loc":"client/src/pages/PublicCollections.tsx:328",className:"text-sm text-muted-foreground line-clamp-2 mb-2",children:s.description}),s.shareableLink&&e.jsxs("a",{"data-loc":"client/src/pages/PublicCollections.tsx:333",href:s.shareableLink,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline mb-2 truncate max-w-full",onClick:g=>g.stopPropagation(),children:[e.jsx(I,{"data-loc":"client/src/pages/PublicCollections.tsx:340",className:"w-3 h-3 flex-shrink-0"}),e.jsx("span",{"data-loc":"client/src/pages/PublicCollections.tsx:341",className:"truncate",children:s.shareableLink})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:344",className:"flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{"data-loc":"client/src/pages/PublicCollections.tsx:345",className:"flex items-center gap-1",children:[e.jsx(W,{"data-loc":"client/src/pages/PublicCollections.tsx:346",className:"w-3 h-3"}
6),s.viewCount.toLocaleString()," views"]}),e.jsxs("span",{"data-loc":"client/src/pages/PublicCollections.tsx:349",children:["Updated ",xe(new Date(s.updatedAt),{addSuffix:!0})]})]})]})]})}),(s.profession||s.category)&&e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:359",className:"flex flex-wrap gap-1.5 mt-3",children:[s.profession&&e.jsx("span",{"data-loc":"client/src/pages/PublicCollections.tsx:361",className:`text-xs px-2 py-0.5 rounded-full font-medium ${Y[s.profession]??"bg-muted text-muted-foreground"}`,children:s.profession}),s.category&&e.jsx("span",{"data-loc":"client/src/pages/PublicCollections.tsx:366",className:"text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground",children:s.category})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:372",className:"flex items-center gap-2 mt-4 pt-3 border-t flex-wrap",children:[e.jsx(ge,{"data-loc":"client/src/pages/PublicCollections.tsx:373",collection:s,onUpdated:c}),s.isPublic&&e.jsxs(e.Fragment,{children:[e.jsxs(b,{"data-loc":"client/src/pages/PublicCollections.tsx:376",size:"sm",variant:"outline",className:"h-8 px-3 text-xs",onClick:a,children:[e.jsx(ne,{"data-loc":"client/src/pages/PublicCollections.tsx:377",className:"w-3 h-3 mr-1"}),"Copy Link"]}),e.jsxs(b,{"data-loc":"client/src/pages/PublicCollections.tsx:380",size:"sm",variant:"outline",className:"h-8 px-3 text-xs",onClick:()=>window.open(`/c/${s.slug}`,"_blank"),children:[e.jsx(I,{"data-loc":"client/src/pages/PublicCollections.tsx:386",className:"w-3 h-3 mr-1"}),"Preview"]})]}),e.jsx(b,{"data-loc":"client/src/pages/PublicCollections.tsx:391",size:"sm",variant:"ghost",className:"h-8 px-3 text-xs text-destructive hover:text-destructive ml-auto",onClick:()=>r(s.id),children:e.jsx(re,{"data-loc":"client/src/pages/PublicCollections.tsx:397",className:"w-3 h-3"})})]})]})})}function pe({collection:s}){const r=s.profession?Y[s.profession]??"bg-muted text-muted-foreground":"";return e.jsx(T,{"data-loc":"client/src/pages/PublicCollections.tsx:428",className:"hover:shadow-lg transition-all duration-200 hover:-translate-y-1 cursor-pointer group",onClick:()=>window.open(`/c/${s.slug}`,"_blank"),children:e.jsxs(M,{"data-loc":"client/src/pages/PublicCollections.tsx:432",className:"p-5",children:[e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:433",className:"flex items-start gap-3 mb-3",children:[e.jsx("span",{"data-loc":"client/src/pages/PublicCollections.tsx:434",className:"text-3xl flex-shrink-0",children:s.icon}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:435",className:"flex-1 min-w-0",children:[e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:436",className:"flex items-center gap-1.5 mb-1 flex-wrap",children:[s.isFeatured&&e.jsx(Q,{"data-loc":"client/src/pages/PublicCollections.tsx:438",className:"w-3.5 h-3.5 text-amber-500 fill-amber-500 flex-shrink-0"}),e.jsx("h3",{"data-loc":"client/src/pages/PublicCollections.tsx:440",className:"font-semibold text-sm truncate group-hover:text-primary transition-colors",children:s.title})]}),s.description&&e.jsx("p",{"data-loc":"client/src/pages/PublicCollections.tsx:445",className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:s.description})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:452",className:"flex flex-wrap gap-1.5 mb-3",children:[s.profession&&e.jsx("span",{"data-loc":"client/src/pages/PublicCollections.tsx:454",className:`text-xs px-2 py-0.5 rounded-full font-medium ${r}`,children:s.profession}),s.category&&e.jsx("span",{"data-loc":"client/src/pages/PublicCollections.tsx:459",className:"text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground",children:s.category})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:465",className:"flex items-center justify-between text-xs text-muted-foreground",children:[e.jsxs("span",{"data-loc":"client/src/pages/PublicCollections.tsx:466",className:"flex items-center gap-1",children:[e.jsx(W,{"data-loc":"client/src/pages/PublicCollections.tsx:467",className:"w-3 h-3"}
6),s.viewCount.toLocaleString()," views"]}),s.ownerName&&e.jsxs("span",{"data-loc":"client/src/pages/PublicCollections.tsx:471",className:"truncate max-w-[120px]",children:["by ",s.ownerName]})]})]})})}function R({onCreated:s}){const[r,c]=i.useState(!1),[d,a]=i.useState(""),[g,m]=i.useState(""),[p,o]=i.useState(""),[l,x]=i.useState("🔖"),[v,N]=i.useState(!0),E=C.useUtils(),j=C.publicCollections.create.useMutation({onSuccess:()=>{P.success("Collection created!"),c(!1),a(""),m(""),o(""),x("🔖"),N(!0),E.publicCollections.getMine.invalidate(),s()},onError:n=>P.error(n.message)});return e.jsxs(U,{"data-loc":"client/src/pages/PublicCollections.tsx:504",open:r,onOpenChange:c,children:[e.jsx(z,{"data-loc":"client/src/pages/PublicCollections.tsx:505",asChild:!0,children:e.jsxs(b,{"data-loc":"client/src/pages/PublicCollections.tsx:506",className:"gap-2",children:[e.jsx(ie,{"data-loc":"client/src/pages/PublicCollections.tsx:507",className:"w-4 h-4"}),"New Collection"]})}),e.jsxs(V,{"data-loc":"client/src/pages/PublicCollections.tsx:511",className:"sm:max-w-md",children:[e.jsx(_,{"data-loc":"client/src/pages/PublicCollections.tsx:512",children:e.jsx(G,{"data-loc":"client/src/pages/PublicCollections.tsx:513",children:"Create Public Collection"})}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:515",className:"space-y-4 pt-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:517",children:[e.jsx(u,{"data-loc":"client/src/pages/PublicCollections.tsx:518",className:"text-sm font-medium mb-2 block",children:"Icon"}),e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:519",className:"flex flex-wrap gap-2",children:J.map(n=>e.jsx("button",{"data-loc":"client/src/pages/PublicCollections.tsx:521",onClick:()=>x(n),className:`text-xl w-9 h-9 rounded-md border-2 transition-colors ${l===n?"border-primary bg-primary/10":"border-transparent hover:border-muted-foreground/30"}`,children:n},n))})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:536",children:[e.jsxs(u,{"data-loc":"client/src/pages/PublicCollections.tsx:537",htmlFor:"col-title",className:"text-sm font-medium mb-1.5 block",children:["Title ",e.jsx("span",{"data-loc":"client/src/pages/PublicCollections.tsx:538",className:"text-destructive",children:"*"})]}),e.jsx(k,{"data-loc":"client/src/pages/PublicCollections.tsx:540",id:"col-title",placeholder:"e.g. Best AI Tools 2025",value:d,onChange:n=>a(n.target.value),maxLength:255})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:549",children:[e.jsx(u,{"data-loc":"client/src/pages/PublicCollections.tsx:550",htmlFor:"col-desc",className:"text-sm font-medium mb-1.5 block",children:"Description"}),e.jsx(q,{"data-loc":"client/src/pages/PublicCollections.tsx:553",id:"col-desc",placeholder:"What is this collection about?",value:g,onChange:n=>m(n.target.value),rows:3,maxLength:2e3})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:563",children:[e.jsxs(u,{"data-loc":"client/src/pages/PublicCollections.tsx:564",htmlFor:"col-link",className:"text-sm font-medium mb-1.5 block",children:["Shareable Link ",e.jsx("span",{"data-loc":"client/src/pages/PublicCollections.tsx:565",className:"text-muted-foreground font-normal",children:"(optional)"})]}),e.jsx(k,{"data-loc":"client/src/pages/PublicCollections.tsx:567",id:"col-link",type:"url",placeholder:"https://notion.so/my-collection or any external URL",value:p,onChange:n=>o(n.target.value),maxLength:512}),e.jsx("p",{"data-loc":"client/src/pages/PublicCollections.tsx:575",className:"text-xs text-muted-foreground mt-1",children:"Link to a Notion page, Google Doc, or any external resource for this collection."})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:578",className:"flex items-center justify-between p-3 rounded-lg bg-muted/50 border",children:[e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:579",children:[e.jsx(u,{"data-loc":"client/src/pages/PublicCollections.tsx:580",htmlFor:"col-public",className:"font-medium",children:"Make Public"}),e.jsx("p",{"data-loc":"client/src/pages/PublicCollections.tsx:581",className:"text-xs text-muted-foreground mt-0.5",children:"Anyone with the link can view this collection"})]}),e.jsx(H,{"data-loc":"client/src/pages/PublicCollections.tsx:585",id:"col-public",checked:v,onCheckedChange:N})]}),e.jsx(b,{"data-loc":"client/src/pages/PublicCollections.tsx:592",className:"w-full",onClick:()=>j.mutate({title:d,description:g,shareableLink:p||void 0,icon:l,isPublic:v}),disabled:!d.trim()||j.isPending,children:j.isPending?"Creating...":"Create Collection"})]})]})]})}function me(){const[s,r]=i.useState("All Professions"),[c,d]=i.useState("All Categories"),[a,g]=i.useState(!1),{data:m,isLoading:p}=C.publicCollections.browse.useQuery({profession:s==="All Professions"?void 0:s,category:c==="All Categories"?void 0:c,featured:a||void 0,limit:24,offset:0}),o=m?.collections??[];return e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:621",children:[e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:623",className:"flex flex-wrap items-center gap-3 mb-6 p-4 rounded-xl bg-muted/30 border",children:[e.jsx(ue,{"data-loc":"client/src/pages/PublicCollections.tsx:624",className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsxs(w,{"data-loc":"client/src/pages/PublicCollections.tsx:625",value:s,onValueChange:r,children:[e.jsx(y,{"data-loc":"client/src/pages/PublicCollections.tsx:626",className:"w-44 h-9 text-sm",children:e.jsx(S,{"data-loc":"client/src/pages/PublicCollections.tsx:627",placeholder:"Profession"})}),e.jsx(L,{"data-loc":"client/src/pages/PublicCollections.tsx:629",children:K.map(l=>e.jsx(f,{"data-loc":"client/src/pages/PublicCollections.tsx:631",value:l,children:l},l))})]}),e.jsxs(w,{"data-loc":"client/src/pages/PublicCollections.tsx:635",value:c,onValueChange:d,children:[e.jsx(y,{"data-loc":"client/src/pages/PublicCollections.tsx:636",className:"w-40 h-9 text-sm",children:e.jsx(S,{"data-loc":"client/src/pages/PublicCollections.tsx:637",placeholder:"Category"})}),e.jsx(L,{"data-loc":"client/src/pages/PublicCollections.tsx:639",children:X.map(l=>e.jsx(f,{"data-loc":"client/src/pages/PublicCollections.tsx:641",value:l,children:l},l))})]}),e.jsxs(b,{"data-loc":"client/src/pages/PublicCollections.tsx:645",size:"sm",variant:a?"default":"outline",className:"h-9 gap-1.5",onClick:()=>g(!a),children:[e.jsx(Q,{"data-loc":"client/src/pages/PublicCollections.tsx:651",className:`w-3.5 h-3.5 ${a?"fill-current":""}`}),"Featured"]}),(s!=="All Professions"||c!=="All Categories"||a)&&e.jsx(b,{"data-loc":"client/src/pages/PublicCollections.tsx:655",size:"sm",variant:"ghost",className:"h-9 text-muted-foreground",onClick:()=>{r("All Professions"),d("All Categories"),g(!1)},children:"Clear filters"})]}),p?e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:668",className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:6}).map((l,x)=>e.jsx(T,{"data-loc":"client/src/pages/PublicCollections.tsx:670",children:e.jsx(M,{"data-loc":"client/src/pages/PublicCollections.tsx:671",className:"p-5 space-y-3",children:e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:672",className:"flex gap-3",children:[e.jsx(h,{"data-loc":"client/src/pages/PublicCollections.tsx:673",className:"w-10 h-10 rounded"}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:674",className:"flex-1 space-y-2",children:[e.jsx(h,{"data-loc":"client/src/pages/PublicCollections.tsx:675",className:"h-4 w-3/4"}),e.jsx(h,{"data-loc":"client/src/pages/PublicCollections.tsx:676",className:"h-3 w-full"}),e.jsx(h,{"data-loc":"client/src/pages/PublicCollections.tsx:677",className:"h-3 w-1/2"})]})]})})},x))}):o.length===0?e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:685",className:"text-center py-16",children:[e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:686",className:"w-14 h-14 roun
6ded-2xl bg-muted flex items-center justify-center mx-auto mb-4",children:e.jsx(oe,{"data-loc":"client/src/pages/PublicCollections.tsx:687",className:"w-7 h-7 text-muted-foreground"})}),e.jsx("h3",{"data-loc":"client/src/pages/PublicCollections.tsx:689",className:"text-lg font-semibold mb-2",children:"No collections found"}),e.jsx("p",{"data-loc":"client/src/pages/PublicCollections.tsx:690",className:"text-sm text-muted-foreground max-w-xs mx-auto",children:"Try adjusting your filters or be the first to share a collection for this profession."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{"data-loc":"client/src/pages/PublicCollections.tsx:696",className:"text-xs text-muted-foreground mb-4",children:[o.length," collection",o.length!==1?"s":""," found"]}),e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:699",className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:o.map(l=>e.jsx(pe,{"data-loc":"client/src/pages/PublicCollections.tsx:701",collection:l},l.id))})]})]})}function _e(){const[s,r]=i.useState("mine"),{data:c,isLoading:d,refetch:a}=C.publicCollections.getMine.useQuery(),g=C.useUtils(),m=C.publicCollections.delete.useMutation({onSuccess:()=>{P.success("Collection deleted"),g.publicCollections.getMine.invalidate()},onError:l=>P.error(l.message)}),p=c?.filter(l=>l.isPublic)??[],o=c?.filter(l=>!l.isPublic)??[];return e.jsx(ce,{"data-loc":"client/src/pages/PublicCollections.tsx:728",children:e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:729",className:"max-w-5xl mx-auto px-4 py-8",children:[e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:731",className:"flex items-start justify-between mb-6 gap-4",children:[e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:732",children:e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:733",className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:734",className:"w-10 h-10 rounded-xl bg-gradient-to-br from-emerald-500 to-teal-600 flex items-center justify-center flex-shrink-0",children:e.jsx(ae,{"data-loc":"client/src/pages/PublicCollections.tsx:735",className:"w-5 h-5 text-white"})}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:737",children:[e.jsx("h1",{"data-loc":"client/src/pages/PublicCollections.tsx:738",className:"text-2xl font-bold tracking-tight",children:"Public Collections"}),e.jsx("p",{"data-loc":"client/src/pages/PublicCollections.tsx:739",className:"text-sm text-muted-foreground",children:"Share curated bookmark lists with the world"})]})]})}),s==="mine"&&e.jsx(R,{"data-loc":"client/src/pages/PublicCollections.tsx:743",onCreated:a})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:747",className:"flex gap-1 p-1 rounded-lg bg-muted/50 border w-fit mb-8",children:[e.jsxs("button",{"data-loc":"client/src/pages/PublicCollections.tsx:748",onClick:()=>r("mine"),className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors ${s==="mine"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx(A,{"data-loc":"client/src/pages/PublicCollections.tsx:756",className:"w-4 h-4"}),"My Collections",c&&c.length>0&&e.jsx("span",{"data-loc":"client/src/pages/PublicCollections.tsx:759",className:"ml-1 text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:c.length})]}),e.jsxs("button",{"data-loc":"client/src/pages/PublicCollections.tsx:764",onClick:()=>r("marketplace"),className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors ${s==="marketplace"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx(le,{"data-loc":"client/src/pages/PublicCollections.tsx:772",className:"w-4 h-4"}),"Marketplace",e.jsx("span",{"data-loc":"client/src/pages/PublicCollections.tsx:774",className:"ml-1 text-xs bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 px-1.5 py-0.5 rounded-full font-semibold",children:"New"})]})]}),s==="marketplace"?e.jsx(me,{"data-loc":"client/src/pages/PublicCollections.tsx:782"}):e.jsxs(e.Fragment,{children:[c&&c.length>0&&e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:787",className:"grid grid-cols-3 gap-3 mb-8",children:[e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:788",className:"p-3 rounded-lg bg-muted/50 border text-center",children:[e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:789",className:"text-2xl font-bold",children:c.length}),e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:790",className:"text-xs text-muted-foreground",children:"Collections"})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:792",className:"p-3 rounded-lg bg-muted/50 border text-center",children:[e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:793",className:"text-2xl font-bold",children:p.length}),e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:794",className:"text-xs text-muted-foreground",children:"Public"})]}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:796",className:"p-3 rounded-lg bg-muted/50 border text-center",children:[e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:797",className:"text-2xl font-bold",children:c.reduce((l,x)=>
6l+x.viewCount,0).toLocaleString()}),e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:800",className:"text-xs text-muted-foreground",children:"Total Views"})]})]}),d?e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:807",className:"space-y-4",children:[1,2,3].map(l=>e.jsx(T,{"data-loc":"client/src/pages/PublicCollections.tsx:809",children:e.jsx(M,{"data-loc":"client/src/pages/PublicCollections.tsx:810",className:"p-5",children:e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:811",className:"flex gap-3",children:[e.jsx(h,{"data-loc":"client/src/pages/PublicCollections.tsx:812",className:"w-8 h-8 rounded"}),e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:813",className:"flex-1 space-y-2",children:[e.jsx(h,{"data-loc":"client/src/pages/PublicCollections.tsx:814",className:"h-5 w-1/2"}),e.jsx(h,{"data-loc":"client/src/pages/PublicCollections.tsx:815",className:"h-4 w-3/4"}),e.jsx(h,{"data-loc":"client/src/pages/PublicCollections.tsx:816",className:"h-4 w-1/3"})]})]})})},l))}):!c||c.length===0?e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:824",className:"text-center py-16",children:[e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:825",className:"w-16 h-16 rounded-2xl bg-muted flex items-center justify-center mx-auto mb-4",children:e.jsx(A,{"data-loc":"client/src/pages/PublicCollections.tsx:826",className:"w-8 h-8 text-muted-foreground"})}),e.jsx("h2",{"data-loc":"client/src/pages/PublicCollections.tsx:828",className:"text-xl font-semibold mb-2",children:"No collections yet"}),e.jsx("p",{"data-loc":"client/src/pages/PublicCollections.tsx:829",className:"text-muted-foreground text-sm max-w-sm mx-auto mb-6",children:"Create your first curated collection and share it with the world. Every public collection is a unique landing page that can bring new users to MarkRepo."}),e.jsx(R,{"data-loc":"client/src/pages/PublicCollections.tsx:832",onCreated:a})]}):e.jsxs("div",{"data-loc":"client/src/pages/PublicCollections.tsx:835",className:"space-y-6",children:[p.length>0&&e.jsxs("section",{"data-loc":"client/src/pages/PublicCollections.tsx:837",children:[e.jsxs("h2",{"data-loc":"client/src/pages/PublicCollections.tsx:838",className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide mb-3 flex items-center gap-2",children:[e.jsx($,{"data-loc":"client/src/pages/PublicCollections.tsx:839",className:"w-4 h-4"}),"Public (",p.length,")"]}),e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:842",className:"space-y-3",children:p.map(l=>e.jsx(O,{"data-loc":"client/src/pages/PublicCollections.tsx:844",collection:l,onDelete:x=>m.mutate({id:x}),onUpdated:a},l.id))})]}),o.length>0&&e.jsxs("section",{"data-loc":"client/src/pages/PublicCollections.tsx:856",children:[e.jsxs("h2",{"data-loc":"client/src/pages/PublicCollections.tsx:857",className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide mb-3 flex items-center gap-2",children:[e.jsx(B,{"data-loc":"client/src/pages/PublicCollections.tsx:858",className:"w-4 h-4"}),"Private (",o.length,")"]}),e.jsx("div",{"data-loc":"client/src/pages/PublicCollections.tsx:861",className:"space-y-3",children:o.map(l=>e.jsx(O,{"data-loc":"client/src/pages/PublicCollections.tsx:863",collection:l,onDelete:x=>m.mutate({id:x}),onUpdated:a},l.id))})]})]})]})]})})}export{_e 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.