import{d as e}from"./objectSpread2-DtFdQpqy.js";import{a as t,n}from"./preload-helper-EQ20WQt-.js";import{c as r,l as i,o as a}from"./prop-types-DdDwMzX7.js";import{T as o,lt as s}from"./poll-UAe1CGVf.js";import{Do as c,Eo as l,Qi as u,mn as d}from"./time-C7shVqCd.js";import{t as f}from"./helmet-xJbX5x_5.js";import{n as p}from"./short_number-CCNBtmoH.js";import{t as m}from"./column-CvSGioVA.js";import{sn as h}from"./status_quoted-CRoil4HW.js";import{t as g}from"./add-CAXW-Ycv.js";import{n as _,t as v}from"./lists-BeV0TEky.js";import{a as y}from"./columns_area-DbT75EJ-.js";import{t as b}from"./scrollable_list-d6jZVFfD.js";import{t as x}from"./squiggly_arrow-djOiF794.js";var S=e(t()),C=n(),w=r({heading:{id:`column.lists`,defaultMessage:`Lists`},create:{id:`lists.create_list`,defaultMessage:`Create list`},edit:{id:`lists.edit`,defaultMessage:`Edit list`},delete:{id:`lists.delete`,defaultMessage:`Delete list`},more:{id:`status.more`,defaultMessage:`More`}}),T=({id:e,title:t})=>{let n=l(),r=i(),a=(0,S.useCallback)(()=>{n(u({modalType:`CONFIRM_DELETE_LIST`,modalProps:{listId:e}}))},[n,e]),c=(0,S.useMemo)(()=>[{text:r.formatMessage(w.edit),to:`/lists/${e}/edit`},{text:r.formatMessage(w.delete),action:a}],[r,e,a]);return(0,C.jsxs)(`div`,{className:`lists__item`,children:[(0,C.jsxs)(p,{to:`/lists/${e}`,className:`lists__item__title`,children:[(0,C.jsx)(s,{id:`list-ul`,icon:_}),(0,C.jsx)(`span`,{children:t})]}),(0,C.jsx)(o,{scrollKey:`lists`,items:c,icon:`ellipsis-h`,iconComponent:h,title:r.formatMessage(w.more)})]})},E=({multiColumn:e})=>{let t=l(),n=i(),r=c(e=>v(e));(0,S.useEffect)(()=>{t(d())},[t]);let o=(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`span`,{children:[(0,C.jsx)(a,{id:`lists.no_lists_yet`,defaultMessage:`No lists yet.`}),(0,C.jsx)(`br`,{}),(0,C.jsx)(a,{id:`lists.create_a_list_to_organize`,defaultMessage:`Create a new list to organize your Home feed`})]}),(0,C.jsx)(x,{className:`empty-column-indicator__arrow`})]});return(0,C.jsxs)(m,{bindToDocument:!e,label:n.formatMessage(w.heading),children:[(0,C.jsx)(y,{title:n.formatMessage(w.heading),icon:`list-ul`,iconComponent:_,multiColumn:e,extraButton:(0,C.jsx)(p,{to:`/lists/new`,className:`column-header__button`,title:n.formatMessage(w.create),"aria-label":n.formatMessage(w.create),children:(0,C.jsx)(s,{id:`plus`,icon:g})})}),(0,C.jsx)(b,{scrollKey:`lists`,emptyMessage:o,bindToDocument:!e,children:r.map(e=>(0,C.jsx)(T,{id:e.id,title:e.title},e.id))}),(0,C.jsxs)(f,{children:[(0,C.jsx)(`title`,{children:n.formatMessage(w.heading)}),(0,C.jsx)(`meta`,{name:`robots`,content:`noindex`})]})]})};export{E as default};
//# sourceMappingURL=lists-CIviq7vh.js.map