
import React from 'react';
import PropTypes from 'prop-types';
import ReduxToastr from 'react-redux-toastr';
import './toaster.scss';


const Toaster = ({
  timeOut, newestOnTop, preventDuplicates,
  position, transitionIn, transitionOut,
  progressBar, icon, component, confirmOptions }) => (
    <ReduxToastr
      timeOut={timeOut}
      newestOnTop={newestOnTop}
      preventDuplicates={preventDuplicates}
      position={position}
      transitionIn={transitionIn}
      transitionOut={transitionOut}
      progressBar={progressBar}
      component={component}
      icon={icon}
      confirmOptions={confirmOptions}
    />
  );

Toaster.propTypes = {
  timeOut: PropTypes.number,
  newestOnTop: PropTypes.bool,
  preventDuplicates: PropTypes.bool,
  position: PropTypes.string,
  transitionIn: PropTypes.string,
  transitionOut: PropTypes.string,
  progressBar: PropTypes.bool,
  icon: PropTypes.node,
  component: PropTypes.node,
  confirmOptions: PropTypes.object
};

Toaster.defaultProps = {
  timeOut: 2000,
  newestOnTop: true,
  preventDuplicates: false,
  position: 'bottom-right',
  transitionIn: 'fadeIn',
  transitionOut: 'fadeOut',
  progressBar: false,
  icon: null,
  component: null,
  confirmOptions: {}
};

export default Toaster;
