import { DepositsTypes } from "@/api/depositsApi";
import Empty from "@/components/Empty";
import { server } from "@/utils/server";
import DepositData from "./DepositData";

const getDepositApi = async () => {
    return server
        .request<DepositsTypes[]>({
            url: "/v1/api/user/user_deposit_config",
            method: "post",
        })
        .then((res) => {
            if (res.code === 200) return res.data;
            return [];
        });
};
const Deposit = async () => {
    const deposits = await getDepositApi();
    if (!deposits.length) return <Empty />;
    return (
        <>
            <DepositData deposits={deposits} />
        </>
    );
};

export default Deposit;
