|
|
|
@ -1,9 +1,14 @@
|
|
|
|
|
import React, { useEffect } from 'react';
|
|
|
|
|
import React, { useCallback, useEffect } from 'react';
|
|
|
|
|
import { TopicCard } from '../components/TopicCard';
|
|
|
|
|
import { useAsyncRequest, useGroupPanelContext } from '@capital/common';
|
|
|
|
|
import { Empty } from '@capital/component';
|
|
|
|
|
import {
|
|
|
|
|
showToasts,
|
|
|
|
|
useAsyncRequest,
|
|
|
|
|
useGroupPanelContext,
|
|
|
|
|
} from '@capital/common';
|
|
|
|
|
import { Button, Empty, IconBtn } from '@capital/component';
|
|
|
|
|
import { request } from '../request';
|
|
|
|
|
import './GroupTopicPanelRender.less';
|
|
|
|
|
import { Translate } from '../translate';
|
|
|
|
|
|
|
|
|
|
const GroupTopicPanelRender: React.FC = React.memo(() => {
|
|
|
|
|
const panelInfo = useGroupPanelContext();
|
|
|
|
@ -27,13 +32,29 @@ const GroupTopicPanelRender: React.FC = React.memo(() => {
|
|
|
|
|
fetch();
|
|
|
|
|
}, [fetch]);
|
|
|
|
|
|
|
|
|
|
const handleCreateTopic = useCallback(() => {
|
|
|
|
|
showToasts('TODO: 创建话题');
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="plugin-topic-group-panel">
|
|
|
|
|
{Array.isArray(list) && list.length > 0 ? (
|
|
|
|
|
list.map((_, i) => <TopicCard key={i} />)
|
|
|
|
|
) : (
|
|
|
|
|
<Empty />
|
|
|
|
|
<Empty description={Translate.noTopic}>
|
|
|
|
|
<Button type="primary" onClick={handleCreateTopic}>
|
|
|
|
|
{Translate.createBtn}
|
|
|
|
|
</Button>
|
|
|
|
|
</Empty>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<IconBtn
|
|
|
|
|
className="create-btn"
|
|
|
|
|
size="large"
|
|
|
|
|
icon="mdi:plus"
|
|
|
|
|
title={Translate.createBtn}
|
|
|
|
|
onClick={handleCreateTopic}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|