think/packages/client/src/helpers/url.ts

17 lines
499 B
TypeScript

export const buildUrl = (url) => {
if (typeof window === 'undefined') return url;
return `${window.location.origin}${url}`;
};
export const getWikiShareURL = (wikiId) => {
const url = '/share/wiki/' + wikiId;
if (typeof window === 'undefined') return url;
return window.location.origin + url;
};
export const getDocumentShareURL = (documentId) => {
const url = '/share/document/' + documentId;
if (typeof window === 'undefined') return url;
return window.location.origin + url;
};