import { Divider } from 'antd'; import Title from 'antd/lib/typography/Title'; import React, { useEffect } from 'react'; import { connect } from 'react-redux'; import { actionFullMyCollectionLoad, actionRemovePostsFeedAC } from '../actions'; import { CPosts } from '../components/main/Posts'; import { Container } from './Content'; import { CPreloader } from './Preloader'; export const CollectionPage = ({ posts, onLoadPosts, postsRemove }) => { useEffect(() => { onLoadPosts() return () => { postsRemove() } }, []) return ( Collections {posts.lenght ? : The collection is empty. Add posts to your collection } ) } export const CCollectionPage = connect(state => ({ posts: state?.postsFeed?.posts || [] }), { onLoadPosts: actionFullMyCollectionLoad, postsRemove: actionRemovePostsFeedAC })(CollectionPage)