import { Map } from 'immutable';
import { createSelector } from 'reselect';

const getState = (state) => state;

export const getProfile = createSelector(
    [getState],
    (state) => state.get('profile'),
);

export const getNomDeBid = createSelector(
    [getProfile],
    (profile) => profile.get('nomDeBid'),
);

export const getProfileAvatarUrl = createSelector(
    [getProfile],
    (profile) => profile.get('avatar'),
);

export const getUserId = createSelector(
    [getProfile],
    (profile) => profile.get('id'),
);

export const getUserInitials = createSelector(
    [getProfile],
    (profile) => profile.get('initials'),
);

export const isAllowedToBid = createSelector(
    [getProfile],
    (profile) => profile.get('isAllowedToBid'),
);

export const isGeneratedNomDeBid = createSelector(
    [getProfile],
    (profile) => profile.get('generatedNomDeBid'),
);

export const isRegisteredAccount = createSelector(
    [getProfile],
    (profile) => profile.get('isRegisteredAccount'),
);
