mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-01 01:25:32 +08:00
### What problem does this PR solve? feat: change all file names to lowercase #1574 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,82 +1,82 @@
|
||||
import ModalManager from '@/components/modal-manager';
|
||||
import { useFetchKnowledgeList } from '@/hooks/knowledgeHook';
|
||||
import { useSelectUserInfo } from '@/hooks/userSettingHook';
|
||||
import { PlusOutlined, SearchOutlined } from '@ant-design/icons';
|
||||
import { Button, Empty, Flex, Input, Space, Spin } from 'antd';
|
||||
import KnowledgeCard from './knowledge-card';
|
||||
import KnowledgeCreatingModal from './knowledge-creating-modal';
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useSearchKnowledge, useSelectKnowledgeListByKeywords } from './hooks';
|
||||
import styles from './index.less';
|
||||
|
||||
const KnowledgeList = () => {
|
||||
const { searchString, handleInputChange } = useSearchKnowledge();
|
||||
const { loading } = useFetchKnowledgeList();
|
||||
const list = useSelectKnowledgeListByKeywords(searchString);
|
||||
const userInfo = useSelectUserInfo();
|
||||
const { t } = useTranslation('translation', { keyPrefix: 'knowledgeList' });
|
||||
|
||||
return (
|
||||
<Flex className={styles.knowledge} vertical flex={1}>
|
||||
<div className={styles.topWrapper}>
|
||||
<div>
|
||||
<span className={styles.title}>
|
||||
{t('welcome')}, {userInfo.nickname}
|
||||
</span>
|
||||
<p className={styles.description}>{t('description')}</p>
|
||||
</div>
|
||||
<Space size={'large'}>
|
||||
<Input
|
||||
placeholder={t('searchKnowledgePlaceholder')}
|
||||
value={searchString}
|
||||
style={{ width: 220 }}
|
||||
allowClear
|
||||
onChange={handleInputChange}
|
||||
prefix={<SearchOutlined />}
|
||||
/>
|
||||
|
||||
<ModalManager>
|
||||
{({ visible, hideModal, showModal }) => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() => {
|
||||
showModal();
|
||||
}}
|
||||
className={styles.topButton}
|
||||
>
|
||||
{t('createKnowledgeBase')}
|
||||
</Button>
|
||||
<KnowledgeCreatingModal
|
||||
visible={visible}
|
||||
hideModal={hideModal}
|
||||
></KnowledgeCreatingModal>
|
||||
</>
|
||||
)}
|
||||
</ModalManager>
|
||||
</Space>
|
||||
</div>
|
||||
<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 className={styles.knowledgeEmpty}></Empty>
|
||||
)}
|
||||
</Flex>
|
||||
</Spin>
|
||||
</Flex>
|
||||
);
|
||||
};
|
||||
|
||||
export default KnowledgeList;
|
||||
import ModalManager from '@/components/modal-manager';
|
||||
import { useFetchKnowledgeList } from '@/hooks/knowledge-hooks';
|
||||
import { useSelectUserInfo } from '@/hooks/user-setting-hooks';
|
||||
import { PlusOutlined, SearchOutlined } from '@ant-design/icons';
|
||||
import { Button, Empty, Flex, Input, Space, Spin } from 'antd';
|
||||
import KnowledgeCard from './knowledge-card';
|
||||
import KnowledgeCreatingModal from './knowledge-creating-modal';
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useSearchKnowledge, useSelectKnowledgeListByKeywords } from './hooks';
|
||||
import styles from './index.less';
|
||||
|
||||
const KnowledgeList = () => {
|
||||
const { searchString, handleInputChange } = useSearchKnowledge();
|
||||
const { loading } = useFetchKnowledgeList();
|
||||
const list = useSelectKnowledgeListByKeywords(searchString);
|
||||
const userInfo = useSelectUserInfo();
|
||||
const { t } = useTranslation('translation', { keyPrefix: 'knowledgeList' });
|
||||
|
||||
return (
|
||||
<Flex className={styles.knowledge} vertical flex={1}>
|
||||
<div className={styles.topWrapper}>
|
||||
<div>
|
||||
<span className={styles.title}>
|
||||
{t('welcome')}, {userInfo.nickname}
|
||||
</span>
|
||||
<p className={styles.description}>{t('description')}</p>
|
||||
</div>
|
||||
<Space size={'large'}>
|
||||
<Input
|
||||
placeholder={t('searchKnowledgePlaceholder')}
|
||||
value={searchString}
|
||||
style={{ width: 220 }}
|
||||
allowClear
|
||||
onChange={handleInputChange}
|
||||
prefix={<SearchOutlined />}
|
||||
/>
|
||||
|
||||
<ModalManager>
|
||||
{({ visible, hideModal, showModal }) => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() => {
|
||||
showModal();
|
||||
}}
|
||||
className={styles.topButton}
|
||||
>
|
||||
{t('createKnowledgeBase')}
|
||||
</Button>
|
||||
<KnowledgeCreatingModal
|
||||
visible={visible}
|
||||
hideModal={hideModal}
|
||||
></KnowledgeCreatingModal>
|
||||
</>
|
||||
)}
|
||||
</ModalManager>
|
||||
</Space>
|
||||
</div>
|
||||
<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 className={styles.knowledgeEmpty}></Empty>
|
||||
)}
|
||||
</Flex>
|
||||
</Spin>
|
||||
</Flex>
|
||||
);
|
||||
};
|
||||
|
||||
export default KnowledgeList;
|
||||
|
||||
Reference in New Issue
Block a user