import React from "react";
import ErrorIcon from "./ErrorIcon";
import styles from "./styles.module.css";

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;
