import Swal, { SweetAlertPosition } from "sweetalert2";

export const Toast = ({ color, title, position = 'top' }: { color: string, title: string, position?: SweetAlertPosition | undefined }) => {
    const toast = Swal.mixin({
        toast: true,
        position,
        showConfirmButton: false,
        timer: 3000,
        showCloseButton: true,
        customClass: {
            popup: `color-${color}`,
        },
    });
    toast.fire({
        title
    });
};