web/plugins/Loading/page.jsx

33 lines
915 B
React
Raw Normal View History

2023-10-19 11:44:56 +03:30
import React, { useContext } from "react";
import AppContext from "@ctx/AppContext";
import gif from "@img/loading.gif";
import Image from "next/image";
2024-11-25 15:31:48 +03:30
import { useLocale, useTranslations } from "next-intl";
2023-10-19 11:44:56 +03:30
const Loading = ({ rateId }) => {
const CTX = useContext(AppContext);
const loading = CTX.state.loading;
2024-11-25 15:31:48 +03:30
const t = useTranslations("extra");
const locale = useLocale();
const isRTL = locale === "fa";
2023-10-19 11:44:56 +03:30
return (
<>
<div
className={`fixed w-full tr03 z-50 ${
loading ? "bottom-5 " : "bottom-[-100px] "
} `}
>
<div className="bg-secondary-950 w-fit rounded-full px-1 py-2 flex rtl m-3 ">
2024-11-25 15:31:48 +03:30
<p className="mb-0 text-primary-300 mx-2 blacj ">{t("loading")}</p>
2023-10-19 11:44:56 +03:30
<div className="w-[30px] ml-3">
<Image src={gif} alt="" className="" />
</div>
</div>
</div>
</>
);
};
export default Loading;