mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 18:16:15 +08:00
feat: rewrite enable affile cloud
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user