import React from 'react'; import { Box, Flex, useTheme } from '@chakra-ui/react'; import { getInforms, readInform } from '@/web/support/user/inform/api'; import { usePagination } from '@/web/common/hooks/usePagination'; import { useLoading } from '@/web/common/hooks/useLoading'; import type { UserInformSchema } from '@fastgpt/global/support/user/inform/type'; import { formatTimeToChatTime } from '@/utils/tools'; import { useSystemStore } from '@/web/common/system/useSystemStore'; import MyIcon from '@/components/Icon'; const BillTable = () => { const theme = useTheme(); const { Loading } = useLoading(); const { isPc } = useSystemStore(); const { data: informs, isLoading, total, pageSize, Pagination, getData, pageNum } = usePagination({ api: getInforms, pageSize: isPc ? 20 : 10 }); return ( {informs.map((item) => ( { if (!item.read) { await readInform(item._id); getData(pageNum); } }} > {item.title} {formatTimeToChatTime(item.time)} {item.content} {!item.read && ( )} ))} {!isLoading && informs.length === 0 && ( 暂无通知~ )} {total > pageSize && ( )} ); }; export default BillTable;