import { useAFFiNEI18N } from '@affine/i18n/hooks'; import type { AffineLegacyCloudWorkspace, LocalWorkspace, } from '@affine/workspace/type'; import { WorkspaceFlavour } from '@affine/workspace/type'; import type { FC } from 'react'; import { descriptionStyle, menuItemStyle } from './index.css'; import type { ShareMenuProps } from './share-menu'; import { StyledButton } from './styles'; const ShareLocalWorkspace: FC> = props => { const t = useAFFiNEI18N(); return (
{t['Share Menu Public Workspace Description1']()}
{ props.onOpenWorkspaceSettings(props.workspace); }} > {t['Open Workspace Settings']()}
); }; const ShareAffineWorkspace: FC< ShareMenuProps > = props => { const isPublicWorkspace = props.workspace.public; const t = useAFFiNEI18N(); return (
{isPublicWorkspace ? t['Share Menu Public Workspace Description2']() : t['Share Menu Public Workspace Description1']()}
{ props.onOpenWorkspaceSettings(props.workspace); }} > {t['Open Workspace Settings']()}
); }; export const ShareWorkspace: FC = props => { if (props.workspace.flavour === WorkspaceFlavour.LOCAL) { return ( )} /> ); } else if (props.workspace.flavour === WorkspaceFlavour.AFFINE) { return ( )} /> ); } throw new Error('Unreachable'); };