|
@@ -0,0 +1,65 @@
|
|
|
+"use client";
|
|
|
+import { RecordBillsResp } from "@/api/betrecord";
|
|
|
+import Empty from "@/components/Empty";
|
|
|
+import { Pagination, Response } from "@/types";
|
|
|
+import { InfiniteScroll, List } from "antd-mobile";
|
|
|
+import dayjs from "dayjs";
|
|
|
+import { FC, useState } from "react";
|
|
|
+
|
|
|
+interface Props {
|
|
|
+ record: Response<RecordBillsResp[]> & Pagination;
|
|
|
+}
|
|
|
+
|
|
|
+const BetRecord: FC<Props> = (props) => {
|
|
|
+ const {
|
|
|
+ record: { data, page },
|
|
|
+ } = props;
|
|
|
+ const [recordBills, setRecordBills] = useState(data);
|
|
|
+ const loadMore = async () => {
|
|
|
+ console.log(`🎯🎯🎯🎯🎯-> in list.tsx on 8`);
|
|
|
+ };
|
|
|
+ if (recordBills.length === 0) return <Empty text={"Sem apostas"} />;
|
|
|
+
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ <List
|
|
|
+ style={{
|
|
|
+ "--border-bottom": "none",
|
|
|
+ "--border-top": "none",
|
|
|
+ "--border-inner": "solid 1px #333333",
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {recordBills.map((_, index) => (
|
|
|
+ <List.Item key={index}>
|
|
|
+ <div className={"flex justify-between"}>
|
|
|
+ <div className={"text-[#999]"}>Mines</div>
|
|
|
+ <div>
|
|
|
+ {Math.random() > 0.5 ? (
|
|
|
+ <span className={"text-[green]"}>
|
|
|
+ + {Math.random().toFixed(1)}
|
|
|
+ </span>
|
|
|
+ ) : (
|
|
|
+ <span className={"text-[red]"}>LOST</span>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ className={
|
|
|
+ "flex justify-between text-[0.10rem] text-[#999]" + " mt-[0.02rem]"
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ Bet: <span>0.4</span>
|
|
|
+ </div>
|
|
|
+ <div>{dayjs().format("DD-MM-YY hh:mm")}</div>
|
|
|
+ </div>
|
|
|
+ </List.Item>
|
|
|
+ ))}
|
|
|
+ </List>
|
|
|
+ <InfiniteScroll loadMore={loadMore} hasMore={!page.is_end} />
|
|
|
+ </>
|
|
|
+ );
|
|
|
+};
|
|
|
+
|
|
|
+export default BetRecord;
|