// import React, { useEffect } from 'react';
import { connect } from 'react-redux';
import { compose } from 'redux';
import { createStructuredSelector } from 'reselect';
//import { fp as _ } from '../../common/utils/fp';
import { ProfileCard } from '../components/profile-card';
import { makeDecodedSelector } from '../../auth/selectors';
import { withErrorBoundary } from '../../common/hoc/with-error-boundary';
import { TUserData } from '../../auth/types';
import { TProfileRootState } from '../types';

type TStructured = {
  userData: TUserData;
};

const mapStateToProps = createStructuredSelector<
  TProfileRootState,
  TStructured
>({
  userData: makeDecodedSelector(),
  //†prop
});

export default compose(
  withErrorBoundary('profile:profile-card'),
  connect(mapStateToProps)
)(ProfileCard);
