import { useCallback } from 'react';

import useHuSnackbar from '@material-hu/components/design-system/Snackbar';
import { SnackbarProps } from '@material-hu/components/design-system/Snackbar/types';

const useSnackbar = () => {
  const { enqueueSnackbar } = useHuSnackbar();

  const showSnackbar = useCallback(
    (props: SnackbarProps) => {
      enqueueSnackbar({
        ...props,
      });
    },
    [enqueueSnackbar],
  );

  return {
    showSnackbar,
  };
};

export default useSnackbar;
