import React from "react";

interface CustomLoadingOverlayProps {
  loadingMessage?: string;
}

export const CustomLoadingOverlay: React.FC<CustomLoadingOverlayProps> = ({
  loadingMessage = "Loading...",
}) => {
  return (
    <div className="ag-overlay-loading-center" role="presentation">
      <div
        style={{
          display: "flex",
          flexDirection: "column", // Arrange icon and text vertically
          alignItems: "center",
          justifyContent: "center",
        }}
      >
        <img
          src="/icon.jpg"
          alt="Loading icon"
          className="animate-spin rounded-full h-10 w-10 object-cover"
        />
        <p className="mt-2 text-sm text-gray-500 dark:text-gray-400">{loadingMessage}</p>
      </div>
    </div>
  );
};
