client: fix build doc url

This commit is contained in:
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 <DocumentLinkCopyer
organizationId={organizationId}
wikiId={wikiId} wikiId={wikiId}
documentId={documentId} documentId={documentId}
render={({ copy, children }) => { render={({ copy, children }) => {

View File

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