您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { ReactComponent as FilterIcon } from '@/assets/filter.svg';
  2. import ModalManager from '@/components/modal-manager';
  3. import { PlusOutlined } from '@ant-design/icons';
  4. import { Button, Flex, Space } from 'antd';
  5. import KnowledgeCard from './knowledge-card';
  6. import KnowledgeCreatingModal from './knowledge-creating-modal';
  7. import { useFetchKnowledgeList } from '@/hooks/knowledgeHook';
  8. import styles from './index.less';
  9. const Knowledge = () => {
  10. const data = useFetchKnowledgeList();
  11. return (
  12. <div className={styles.knowledge}>
  13. <div className={styles.topWrapper}>
  14. <div>
  15. <span className={styles.title}>Welcome back, Zing</span>
  16. <p className={styles.description}>
  17. Which database are we going to use today?
  18. </p>
  19. </div>
  20. <Space size={'large'}>
  21. <Button icon={<FilterIcon />} className={styles.filterButton}>
  22. Filters
  23. </Button>
  24. <ModalManager>
  25. {({ visible, hideModal, showModal }) => (
  26. <>
  27. <Button
  28. type="primary"
  29. icon={<PlusOutlined />}
  30. onClick={() => {
  31. showModal();
  32. }}
  33. className={styles.topButton}
  34. >
  35. Create knowledge base
  36. </Button>
  37. <KnowledgeCreatingModal
  38. visible={visible}
  39. hideModal={hideModal}
  40. ></KnowledgeCreatingModal>
  41. </>
  42. )}
  43. </ModalManager>
  44. </Space>
  45. </div>
  46. <Flex gap="large" wrap="wrap">
  47. {data.map((item: any) => {
  48. return <KnowledgeCard item={item} key={item.name}></KnowledgeCard>;
  49. })}
  50. </Flex>
  51. </div>
  52. );
  53. };
  54. export default Knowledge;