import containerConnect from 'Framework/ComponentContainer';
import { Services } from 'App/ServiceLocator';
import SendEmail from '../../Components/SendEmail';
import { getConfiguration } from '../../../Reducers/Configurator/Selectors';

const mapStateToProps = ({ ui, configurator }) => {
    const { shareUrl } = getConfiguration(configurator);
    return {
        Component: SendEmail,
        show: !!ui.visibilityMap.sendEmail,
        shareUrl,
    };
};

const mapDispatchToProps = () => ({
    onClose: () => Services.ui.hide('sendEmail'),
    onOkClick: () => Services.ui.hide('sendEmail'),
});

export default containerConnect(mapStateToProps, mapDispatchToProps);
