// 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 { makeDecodedSelector } from '../../auth/selectors';
import { UserCard } from '../components/user-card';
import { withErrorBoundary } from '../../common/hoc/with-error-boundary';
import { TUserData } from '../../auth/types';
import { TWelcomeRootState } from '../types';

type TStructured = {
  userData: TUserData;
};

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

export default compose(
  withErrorBoundary('welcome:user-card'),
  connect(mapStateToProps)
)(UserCard);
