import { type FC, useState } from "react"; import { EmptyWallet } from "iconsax-react"; import { useTranslation } from "react-i18next"; import { formatPrice } from "@/helpers/func"; import { useGetWalletBalance } from "../hooks/useWalletData"; import ChargeModal from "./ChargeModal"; import MoonLoader from "react-spinners/MoonLoader"; const WalletHeader: FC = () => { const { t } = useTranslation("global"); const [showChargeModal, setShowChargeModal] = useState(false); const { data, isLoading } = useGetWalletBalance(); const balance = data?.data?.balance ?? 0; return ( <>
{isLoading ? ( ) : ( formatPrice(balance) )}
setShowChargeModal(false)} /> ); }; export default WalletHeader;