import React from 'react';

import { type SnackbarProps } from '../types';

import { useSnackbar } from '..';

const SnackbarWrapper: React.FC<SnackbarProps> = props => {
  const { enqueueSnackbar } = useSnackbar();

  React.useEffect(() => {
    enqueueSnackbar(props);
  }, [props]);

  return null;
};

export default SnackbarWrapper;
