"use strict";(globalThis.webpackChunk_affine_web=globalThis.webpackChunk_affine_web||[]).push([[7935],{37935:(e,l,o)=>{o.r(l),o.d(l,{AllCollection:()=>_,Component:()=>f});var t=o(36870),s=o(77562),c=o(69628),n=o(78380),i=o(24312),a=o(10980),j=o(17049),r=o(61569),h=o(30397),C=o(86326),d=o(79085),x=o(84064),m=o(11352),u=o(63234),w=o(65423),k=o(26798),p=o(45483),b=o(37064);let g=({showCreateNew:e,onCreateCollection:l})=>(0,t.jsx)(w.Y,{right:(0,t.jsx)(u.K0,{size:"16",icon:(0,t.jsx)(p.PlusIcon,{}),onClick:l,className:(0,b.A)("_3sjljj0",!e&&"_3sjljj1")}),center:(0,t.jsx)(k.w,{activeFilter:"collections"})}),_=()=>{let e=(0,i.s9)(),l=(0,a.h1)(j.j).workspace,[o,u]=(0,C.useState)(!0),w=(0,a.h1)(d.Y),k=(0,r.S)(w.collections$),p=(0,C.useMemo)(()=>k.map(e=>({...e,title:e.name})),[k]),b=(0,c.P)(),{open:_,node:f}=(0,s.J7)({title:e["com.arms.editCollection.createCollection"](),showTips:!0}),M=(0,C.useCallback)(()=>{_("").then(e=>{let o=(0,h.Ak)();w.addCollection((0,s.EQ)(o,{name:e})),b.jumpToCollection(l.id,o)}).catch(e=>{console.error(e)})},[w,l,b,_]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.E,{title:e.Collections()}),(0,t.jsx)(n.t,{icon:"collection"}),(0,t.jsx)(x.XP,{children:(0,t.jsx)(g,{showCreateNew:!o,onCreateCollection:M})}),(0,t.jsx)(x.s$,{children:(0,t.jsx)("div",{className:"tj8j2t0",children:p.length>0?(0,t.jsx)(s.MG,{collections:k,collectionMetas:p,setHideHeaderCreateNewCollection:u,node:f,handleCreateCollection:M}):(0,t.jsx)(m.Em,{heading:(0,t.jsx)(s.MZ,{node:f,onCreate:M})})})})]})},f=()=>(0,t.jsx)(_,{})}}]); //# sourceMappingURL=chunk.7935.d0311cae.js.map