client: fix build doc url

pull/130/head
fantasticit 2022-07-15 15:42:20 +08:00
parent 75bf0e9505
commit c380ef7089
2 changed files with 8 additions and 5 deletions

View File

@ -133,6 +133,7 @@ export const DocumentActions: React.FC<IProps> = ({
/>
<DocumentLinkCopyer
organizationId={organizationId}
wikiId={wikiId}
documentId={documentId}
render={({ copy, children }) => {

View File

@ -1,21 +1,23 @@
import { IconLink } from '@douyinfe/semi-icons';
import { Space, Typography } from '@douyinfe/semi-ui';
import { IDocument, IOrganization, IWiki } from '@think/domains';
import { copy } from 'helpers/copy';
import { buildUrl } from 'helpers/url';
import React, { useCallback } from 'react';
interface IProps {
wikiId: string;
documentId: string;
organizationId: IOrganization['id'];
wikiId: IWiki['id'];
documentId: IDocument['id'];
render?: (arg: { copy: () => void; children: React.ReactNode }) => React.ReactNode;
}
const { Text } = Typography;
export const DocumentLinkCopyer: React.FC<IProps> = ({ wikiId, documentId, render }) => {
export const DocumentLinkCopyer: React.FC<IProps> = ({ organizationId, wikiId, documentId, render }) => {
const handle = useCallback(() => {
copy(buildUrl(`/wiki/${wikiId}/document/${documentId}`));
}, [wikiId, documentId]);
copy(buildUrl(`/app/org/${organizationId}/wiki/${wikiId}/doc/${documentId}`));
}, [organizationId, wikiId, documentId]);
const content = (
<Space>