feat: rewrite enable affile cloud

This commit is contained in:
DiamondThree
2023-01-23 10:38:05 +08:00
parent ba7a4378ad
commit 6d41090e27
4 changed files with 31 additions and 38 deletions
@@ -0,0 +1,24 @@
import { useWorkspaceHelper } from '@/hooks/use-workspace-helper';
import { Button } from '@/ui/button';
import { useTranslation } from '@affine/i18n';
import { useState } from 'react';
export const EnableWorkspaceButton = () => {
const { t } = useTranslation();
const { enableWorkspace } = useWorkspaceHelper();
const [loading, setLoading] = useState(false);
return (
<Button
type="primary"
shape="circle"
loading={loading}
onClick={async () => {
setLoading(true);
await enableWorkspace();
setLoading(false);
}}
>
{t('Enable AFFiNE Cloud')}
</Button>
);
};