import React from 'react'; import { Box, Button, Flex, useTheme } from '@chakra-ui/react'; import { getInforms, readInform } from '@/web/support/user/inform/api'; import type { UserInformSchema } from '@fastgpt/global/support/user/inform/type'; import { formatTimeToChatTime } from '@fastgpt/global/common/string/time'; import { usePagination } from '@fastgpt/web/hooks/usePagination'; import { useLoading } from '@fastgpt/web/hooks/useLoading'; import { useTranslation } from 'next-i18next'; import EmptyTip from '@fastgpt/web/components/common/EmptyTip'; import { useSystem } from '@fastgpt/web/hooks/useSystem'; const InformTable = () => { const { t } = useTranslation(); const theme = useTheme(); const { Loading } = useLoading(); const { data: informs, isLoading, total, pageSize, Pagination, getData, pageNum } = usePagination({ api: getInforms, pageSize: 20 }); return ( {informs.map((item) => ( {item.title} ({t(formatTimeToChatTime(item.time) as any).replace('#', ':')}) {!item.read && ( )} {item.content} {!item.read && ( <> )} ))} {!isLoading && informs.length === 0 && ( )} {total > pageSize && ( )} ); }; export default InformTable;