import { useEffect } from "react";
import { Outlet } from "react-router-dom";

interface ICookieYesControllerProps {
  isDelete?: boolean;
}

function CookieYesController({ isDelete = true }: ICookieYesControllerProps) {
  useEffect(() => {
    if (isDelete) {
      document.getElementsByClassName("cky-btn-revisit-wrapper")?.[0]?.remove();
    }
  }, [isDelete]);

  return <Outlet />;
}

export default CookieYesController;
