import React from 'react'; import { Table, Thead, Tbody, Tr, Th, Td, TableContainer, Flex, Box } from '@chakra-ui/react'; import { BillTypeMap } from '@/constants/user'; import { getUserBills } from '@/api/user'; import type { UserBillType } from '@/types/user'; import { usePagination } from '@/hooks/usePagination'; import { useLoading } from '@/hooks/useLoading'; import dayjs from 'dayjs'; import MyIcon from '@/components/Icon'; const BillTable = () => { const { Loading } = useLoading(); const { data: bills, isLoading, Pagination, pageSize, total } = usePagination({ api: getUserBills }); return ( <> {bills.map((item) => ( ))}
时间 类型 底层模型 内容长度 Tokens 长度 金额
{dayjs(item.time).format('YYYY/MM/DD HH:mm:ss')} {BillTypeMap[item.type] || '-'} {item.modelName} {item.textLen} {item.tokenLen} {item.price}元
{!isLoading && bills.length === 0 && ( 无使用记录~ )} {total > pageSize && ( )} ); }; export default BillTable;