import React, { useEffect } from 'react'; import { FormattedMessage } from 'react-intl'; import { useParams } from 'react-router-dom'; import { fetchList } from 'soapbox/actions/lists'; import { openModal } from 'soapbox/actions/modals'; import { connectListStream } from 'soapbox/actions/streaming'; import { expandListTimeline } from 'soapbox/actions/timelines'; import MissingIndicator from 'soapbox/components/missing-indicator'; import { Column, Button, Spinner } from 'soapbox/components/ui'; import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; import Timeline from '../ui/components/timeline'; const ListTimeline: React.FC = () => { const dispatch = useAppDispatch(); const { id } = useParams<{ id: string }>(); const list = useAppSelector((state) => state.lists.get(id)); useEffect(() => { dispatch(fetchList(id)); dispatch(expandListTimeline(id)); const disconnect = dispatch(connectListStream(id)); return () => { disconnect(); }; }, [id]); const handleLoadMore = (maxId: string) => { dispatch(expandListTimeline(id, { maxId })); }; const handleEditClick = () => { dispatch(openModal('LIST_EDITOR', { listId: id })); }; const title = list ? list.title : id; if (typeof list === 'undefined') { return (
); } else if (list === false) { return ( ); } const emptyMessage = (


); return ( ); }; export default ListTimeline;