|
|
|
|
|
|
|
|
} from '@ant-design/icons'; |
|
|
} from '@ant-design/icons'; |
|
|
import { Button, Space, Tooltip } from 'antd'; |
|
|
import { Button, Space, Tooltip } from 'antd'; |
|
|
import { useHandleDeleteFile } from '../hooks'; |
|
|
import { useHandleDeleteFile } from '../hooks'; |
|
|
import styles from './index.less'; |
|
|
|
|
|
|
|
|
|
|
|
interface IProps { |
|
|
interface IProps { |
|
|
record: IFile; |
|
|
record: IFile; |
|
|
|
|
|
|
|
|
<Space size={0}> |
|
|
<Space size={0}> |
|
|
{isKnowledgeBase || ( |
|
|
{isKnowledgeBase || ( |
|
|
<Tooltip title={t('addToKnowledge')}> |
|
|
<Tooltip title={t('addToKnowledge')}> |
|
|
<Button |
|
|
|
|
|
type="text" |
|
|
|
|
|
className={styles.iconButton} |
|
|
|
|
|
onClick={onShowConnectToKnowledgeModal} |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<Button type="text" onClick={onShowConnectToKnowledgeModal}> |
|
|
<LinkOutlined size={20} /> |
|
|
<LinkOutlined size={20} /> |
|
|
</Button> |
|
|
</Button> |
|
|
</Tooltip> |
|
|
</Tooltip> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{isKnowledgeBase || ( |
|
|
{isKnowledgeBase || ( |
|
|
<Tooltip title={t('rename', { keyPrefix: 'common' })}> |
|
|
<Tooltip title={t('rename', { keyPrefix: 'common' })}> |
|
|
<Button |
|
|
|
|
|
type="text" |
|
|
|
|
|
disabled={beingUsed} |
|
|
|
|
|
onClick={onShowRenameModal} |
|
|
|
|
|
className={styles.iconButton} |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<Button type="text" disabled={beingUsed} onClick={onShowRenameModal}> |
|
|
<EditOutlined size={20} /> |
|
|
<EditOutlined size={20} /> |
|
|
</Button> |
|
|
</Button> |
|
|
</Tooltip> |
|
|
</Tooltip> |
|
|
|
|
|
|
|
|
type="text" |
|
|
type="text" |
|
|
disabled={beingUsed} |
|
|
disabled={beingUsed} |
|
|
onClick={onShowMoveFileModal} |
|
|
onClick={onShowMoveFileModal} |
|
|
className={styles.iconButton} |
|
|
|
|
|
> |
|
|
> |
|
|
<SvgIcon name={`move`} width={16}></SvgIcon> |
|
|
<SvgIcon name={`move`} width={16}></SvgIcon> |
|
|
</Button> |
|
|
</Button> |
|
|
|
|
|
|
|
|
)} |
|
|
)} |
|
|
{isKnowledgeBase || ( |
|
|
{isKnowledgeBase || ( |
|
|
<Tooltip title={t('delete', { keyPrefix: 'common' })}> |
|
|
<Tooltip title={t('delete', { keyPrefix: 'common' })}> |
|
|
<Button |
|
|
|
|
|
type="text" |
|
|
|
|
|
disabled={beingUsed} |
|
|
|
|
|
onClick={handleRemoveFile} |
|
|
|
|
|
className={styles.iconButton} |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<Button type="text" disabled={beingUsed} onClick={handleRemoveFile}> |
|
|
<DeleteOutlined size={20} /> |
|
|
<DeleteOutlined size={20} /> |
|
|
</Button> |
|
|
</Button> |
|
|
</Tooltip> |
|
|
</Tooltip> |
|
|
)} |
|
|
)} |
|
|
{record.type !== 'folder' && ( |
|
|
{record.type !== 'folder' && ( |
|
|
<Tooltip title={t('download', { keyPrefix: 'common' })}> |
|
|
<Tooltip title={t('download', { keyPrefix: 'common' })}> |
|
|
<Button |
|
|
|
|
|
type="text" |
|
|
|
|
|
disabled={beingUsed} |
|
|
|
|
|
onClick={onDownloadDocument} |
|
|
|
|
|
className={styles.iconButton} |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<Button type="text" disabled={beingUsed} onClick={onDownloadDocument}> |
|
|
<DownloadOutlined size={20} /> |
|
|
<DownloadOutlined size={20} /> |
|
|
</Button> |
|
|
</Button> |
|
|
</Tooltip> |
|
|
</Tooltip> |
|
|
|
|
|
|
|
|
color="black" |
|
|
color="black" |
|
|
> |
|
|
> |
|
|
<Tooltip title={t('preview')}> |
|
|
<Tooltip title={t('preview')}> |
|
|
<Button type="text" className={styles.iconButton}> |
|
|
|
|
|
|
|
|
<Button type="text"> |
|
|
<EyeOutlined size={20} /> |
|
|
<EyeOutlined size={20} /> |
|
|
</Button> |
|
|
</Button> |
|
|
</Tooltip> |
|
|
</Tooltip> |