import { InfoCircledIcon } from '@radix-ui/react-icons';
import {
  ToastContainer as ToastifyContainer,
  type ToastContainerProps,
} from 'react-toastify';

export { toast } from 'react-toastify';

function CloseButton(): React.ReactNode {
  return null;
}

export function ToastContainer(props: ToastContainerProps): React.ReactNode {
  return (
    <ToastifyContainer
      autoClose={5000}
      closeButton={CloseButton}
      closeOnClick
      draggable
      hideProgressBar
      icon={<InfoCircledIcon />}
      newestOnTop
      pauseOnFocusLoss
      pauseOnHover
      position="bottom-right"
      rtl={false}
      style={{ zIndex: 999999 }}
      {...props}
    />
  );
}
