import user from '../materials/user.png'
import { actionFullProfilePageUser } from '../redux/saga'
import { Avatar, Button } from 'antd'
import { CSearch } from './Search_Users'
import { Link } from 'react-router-dom'
import { connect } from 'react-redux'
import React, { useEffect,useState } from 'react'
export const AddPost = ({ children }) => {
const [state, setState] = useState(false)
return (
<>
setState(!state)}>
{' '}
+{' '}
{!state && children}
>
)
}
export const Feed = () => {
return (
<>
Feed
>
)
}
export const Explore = () => (
{' '}
Explore{' '}
)
const User = ({ my_Id, aboutMe: { _id, login, avatar } = {}, onMyPage }) => {
// console.log('_id in user', _id)
useEffect(() => {
if (my_Id)
onMyPage(my_Id)
}, [my_Id])
return (
{avatar?.url ? (
) : (
)}
)
}
export const CUser = connect(
(state) => ({
my_Id: state.auth?.payload?.sub?.id,
aboutMe: state.myData.aboutMe,
}),
{ onMyPage: actionFullProfilePageUser },
)(User)