fix: disable sending messages if both application and conversation are empty and add loading to all pages (#134)

* feat: add loading to all pages

* fix: disable sending messages if both application and conversation are empty

* feat: add chatSpin class to Spin of chat
This commit is contained in:
balibabu
2024-03-20 11:13:51 +08:00
committed by GitHub
parent d38e92aac8
commit 78727c8809
24 changed files with 629 additions and 473 deletions

View File

@ -1,16 +1,16 @@
import { ReactComponent as FilterIcon } from '@/assets/filter.svg';
import ModalManager from '@/components/modal-manager';
import { useFetchKnowledgeList } from '@/hooks/knowledgeHook';
import { useSelectUserInfo } from '@/hooks/userSettingHook';
import { PlusOutlined } from '@ant-design/icons';
import { Button, Empty, Flex, Space } from 'antd';
import { Button, Empty, Flex, Space, Spin } from 'antd';
import KnowledgeCard from './knowledge-card';
import KnowledgeCreatingModal from './knowledge-creating-modal';
import { useFetchKnowledgeList } from '@/hooks/knowledgeHook';
import { useSelectUserInfo } from '@/hooks/userSettingHook';
import styles from './index.less';
const Knowledge = () => {
const list = useFetchKnowledgeList();
const { list, loading } = useFetchKnowledgeList();
const userInfo = useSelectUserInfo();
return (
@ -50,15 +50,23 @@ const Knowledge = () => {
</ModalManager>
</Space>
</div>
<Flex gap={'large'} wrap="wrap" className={styles.knowledgeCardContainer}>
{list.length > 0 ? (
list.map((item: any) => {
return <KnowledgeCard item={item} key={item.name}></KnowledgeCard>;
})
) : (
<Empty></Empty>
)}
</Flex>
<Spin spinning={loading}>
<Flex
gap={'large'}
wrap="wrap"
className={styles.knowledgeCardContainer}
>
{list.length > 0 ? (
list.map((item: any) => {
return (
<KnowledgeCard item={item} key={item.name}></KnowledgeCard>
);
})
) : (
<Empty></Empty>
)}
</Flex>
</Spin>
</Flex>
);
};