|
@@ -1,35 +1,22 @@
|
|
|
-"use client";
|
|
|
-import { betRecordApi, RecordBillsResp } from "@/api/betrecord";
|
|
|
-import { Pagination } from "@/types";
|
|
|
-import { useSetState } from "ahooks";
|
|
|
-import { InfiniteScroll } from "antd-mobile";
|
|
|
-import { useRef } from "react";
|
|
|
-import Message from "./components/list";
|
|
|
+import FreeRecord from "@/app/[locale]/(navbar)/betrecord/FreeRecord";
|
|
|
+import ReplayRecord from "@/app/[locale]/(navbar)/betrecord/ReplayRecord";
|
|
|
+import Tabs from "@/components/Tabs";
|
|
|
+import { getTranslations } from "next-intl/server";
|
|
|
+import CashRecord from "./CashRecord";
|
|
|
|
|
|
-const Bets = () => {
|
|
|
- const params = useRef({ current_page: 0, page_size: 20, use_page: true });
|
|
|
- const [sourceData, setSourceData] = useSetState<{
|
|
|
- list: RecordBillsResp[];
|
|
|
- page: Partial<Pagination>;
|
|
|
- }>({ list: [], page: { is_end: false } });
|
|
|
-
|
|
|
- const getBetRecordData = async () => {
|
|
|
- return betRecordApi(params.current).then((res) => {
|
|
|
- setSourceData((value) => ({ page: res.page, list: [...value.list, ...res.data] }));
|
|
|
- return res;
|
|
|
- });
|
|
|
- };
|
|
|
- const loadMore = async () => {
|
|
|
- params.current.current_page += 1;
|
|
|
- await getBetRecordData();
|
|
|
- console.log(`🚀🚀🚀🚀🚀-> in page.tsx on 25`, sourceData);
|
|
|
- };
|
|
|
- return (
|
|
|
- <>
|
|
|
- <Message record={sourceData.list} />
|
|
|
- <InfiniteScroll loadMore={loadMore} hasMore={!sourceData.page.is_end!} />
|
|
|
- </>
|
|
|
- );
|
|
|
+const Transactions = async () => {
|
|
|
+ const t = await getTranslations("ProfilePage");
|
|
|
+ const defaultTabs = [
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ name: t("main"),
|
|
|
+ content: 0,
|
|
|
+ render: <CashRecord></CashRecord>,
|
|
|
+ },
|
|
|
+ { id: 2, name: t("gratis"), content: 0, render: <FreeRecord /> },
|
|
|
+ { id: 3, name: t("compensation"), content: 0, render: <ReplayRecord /> },
|
|
|
+ ];
|
|
|
+ return <Tabs items={defaultTabs} />;
|
|
|
};
|
|
|
|
|
|
-export default Bets;
|
|
|
+export default Transactions;
|