import React from "react";

import ErrorIcon from "./ErrorIcon/ErrorIcon";

import styles from "./Toast.module.scss";

interface IToastProps {
  variant: "error" | "success";
  children: React.ReactNode;
  classNameContainer?: string;
  classNameToast?: string;
}

function Toast({
  variant,
  children,
  classNameContainer = "",
  classNameToast = "",
}: IToastProps) {
  return (
    <div className={`${styles.container} ${classNameContainer}`}>
      <div className={`${styles.toast} ${styles[variant]} ${classNameToast}`}>
        {variant === "error" && <ErrorIcon />}
        {variant === "success" && <div />}
        {children}
      </div>
    </div>
  );
}

export default Toast;
