import { Alert, List } from "flowbite-react";
import { FC, useState } from "react";
import { HiCheck, HiExclamation, HiX } from "react-icons/hi";

type AlertProps = {
  type?: string;
  message?: string;
  children?: any;
  data?: Object;
};

const Alerts: FC<AlertProps> = ({ type = "success", children, message='Success' }) => {
  const [show, setShow] = useState(true);
  const icon: any = {
    success: HiCheck,
    failure: HiX,
    warning: HiExclamation,
  };


  return (
    <>
      {show && (
        <Alert color={type} icon={icon[type]} onDismiss>
          {message}
        </Alert>
      )}
    </>
  );
};

export default Alerts;
