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{_ as o,j as s}from"./poll-BqfIhRzt.js";import{Bt as c,Do as l,Eo as u,Ht as d,Ut as f,it as p,rt as m}from"./time-BE5vfriQ.js";import{t as h}from"./helmet-xJbX5x_5.js";import{t as g}from"./column-CvSGioVA.js";import{a as _}from"./columns_area-LrSu9T_Q.js";import{t as v}from"./status_list-ChvZJWS3.js";var y=e(t()),b=n(),x=r({heading:{id:`column.favourites`,defaultMessage:`Favorites`}}),S=({columnId:e,multiColumn:t})=>{let n=u(),r=i(),S=(0,y.useRef)(null),C=l(e=>o(e,`favourites`)),w=l(e=>e.status_lists.getIn([`favourites`,`isLoading`],!0)),T=l(e=>!!e.status_lists.getIn([`favourites`,`next`]));(0,y.useEffect)(()=>{n(p())},[n]);let E=(0,y.useCallback)(()=>{n(e?f(e):c(`FAVOURITES`,{}))},[n,e]),D=(0,y.useCallback)(t=>{n(d(e,t))},[n,e]),O=(0,y.useCallback)(()=>{var e;(e=S.current)==null||e.scrollTop()},[]),k=(0,y.useCallback)(()=>{n(m())},[n]),A=!!e,j=(0,b.jsx)(a,{id:`empty_column.favourited_statuses`,defaultMessage:`You don't have any favorite posts yet. When you favorite one, it will show up here.`});return(0,b.jsxs)(g,{bindToDocument:!t,ref:S,label:r.formatMessage(x.heading),children:[(0,b.jsx)(_,{icon:`star`,iconComponent:s,title:r.formatMessage(x.heading),onPin:E,onMove:D,onClick:O,pinned:A,multiColumn:t}),(0,b.jsx)(v,{trackScroll:!A,statusIds:C,scrollKey:`favourited_statuses-${e}`,hasMore:T,isLoading:w,onLoadMore:k,emptyMessage:j,bindToDocument:!t,timelineId:`favourites`}),(0,b.jsxs)(h,{children:[(0,b.jsx)(`title`,{children:r.formatMessage(x.heading)}),(0,b.jsx)(`meta`,{name:`robots`,content:`noindex`})]})]})};export{S as default};
//# sourceMappingURL=favourited_statuses-PKoRh7Oy.js.map