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{Do as o,Eo as s,Fo as c,L as l,N as u}from"./time-BE5vfriQ.js";import{t as d}from"./helmet-xJbX5x_5.js";import{t as f}from"./column-CvSGioVA.js";import{un as p}from"./status_quoted-DSI-CjDl.js";import{r as m}from"./navigation_panel-U2eLp0Ah.js";import{n as h}from"./hashtag-C7Jzvxbz.js";import{a as g}from"./columns_area-Dy3CaEgt.js";import{t as _}from"./scrollable_list-DOt8AyRo.js";var v=e(t()),y=n(),b=r({heading:{id:`followed_tags`,defaultMessage:`Followed hashtags`}}),x=({tag:e,onUnfollow:t})=>{var n,r;let i=s(),o=e.name,u=(0,v.useCallback)(()=>{i(l({tagId:o})).then(e=>(c(e)&&t(o),``))},[i,t,o]),d=parseInt(e.history[0].accounts)+parseInt((n=(r=e.history[1])==null?void 0:r.accounts)==null?``:n);return(0,y.jsx)(h,{name:e.name,to:`/tags/${e.name}`,withGraph:!1,people:d,children:(0,y.jsx)(p,{onClick:u,children:(0,y.jsx)(a,{id:`account.unfollow`,defaultMessage:`Unfollow`})})})},S=({multiColumn:e})=>{let t=i(),n=s(),{tags:r,loading:c,next:p,stale:h}=o(e=>e.followedTags),S=!!p;(0,v.useEffect)(()=>{h&&n(u())},[n,h]);let C=(0,v.useCallback)(()=>{p&&n(u({next:p}))},[n,p]),w=(0,v.useCallback)(e=>{n(l({tagId:e}))},[n]),T=(0,v.useRef)(null),E=(0,v.useCallback)(()=>{var e;(e=T.current)==null||e.scrollTop()},[]),D=(0,y.jsx)(a,{id:`empty_column.followed_tags`,defaultMessage:`You have not followed any hashtags yet. When you do, they will show up here.`});return(0,y.jsxs)(f,{bindToDocument:!e,ref:T,label:t.formatMessage(b.heading),children:[(0,y.jsx)(g,{icon:`hashtag`,iconComponent:m,title:t.formatMessage(b.heading),onClick:E,multiColumn:e,showBackButton:!0}),(0,y.jsx)(_,{scrollKey:`followed_tags`,emptyMessage:D,hasMore:S,isLoading:c,showLoading:c&&r.length===0,onLoadMore:C,trackScroll:!e,bindToDocument:!e,children:r.map(e=>(0,y.jsx)(x,{tag:e,onUnfollow:w},e.name))}),(0,y.jsxs)(d,{children:[(0,y.jsx)(`title`,{children:t.formatMessage(b.heading)}),(0,y.jsx)(`meta`,{name:`robots`,content:`noindex`})]})]})};export{S as default};
//# sourceMappingURL=followed_tags-DPgWS6pP.js.map