diff --git a/packages/common/infra/src/modules/workspace/entities/list.ts b/packages/common/infra/src/modules/workspace/entities/list.ts index 52f01c3333..e965262998 100644 --- a/packages/common/infra/src/modules/workspace/entities/list.ts +++ b/packages/common/infra/src/modules/workspace/entities/list.ts @@ -17,6 +17,12 @@ export class WorkspaceList extends Entity { .flat() .map(isLoadings => isLoadings.some(isLoading => isLoading)); + workspace$(id: string) { + return this.workspaces$.map(workspaces => + workspaces.find(workspace => workspace.id === id) + ); + } + constructor(private readonly providers: WorkspaceFlavourProvider[]) { super(); } diff --git a/packages/frontend/component/src/components/card/workspace-card/index.tsx b/packages/frontend/component/src/components/card/workspace-card/index.tsx deleted file mode 100644 index 69f4c8c9b8..0000000000 --- a/packages/frontend/component/src/components/card/workspace-card/index.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import { WorkspaceAvatar } from '@affine/component/workspace-avatar'; -import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant'; -import { WorkspaceFlavour } from '@affine/env/workspace'; -import { CollaborationIcon, SettingsIcon } from '@blocksuite/icons/rc'; -import type { WorkspaceMetadata } from '@toeverything/infra'; -import { type MouseEvent, useCallback } from 'react'; - -import { Button } from '../../../ui/button'; -import { Skeleton } from '../../../ui/skeleton'; -import * as styles from './styles.css'; - -export interface WorkspaceTypeProps { - flavour: WorkspaceFlavour; - isOwner: boolean; -} - -export interface WorkspaceCardProps { - currentWorkspaceId?: string | null; - meta: WorkspaceMetadata; - onClick: (metadata: WorkspaceMetadata) => void; - onSettingClick: (metadata: WorkspaceMetadata) => void; - onEnableCloudClick?: (meta: WorkspaceMetadata) => void; - isOwner?: boolean; - openingId?: string | null; - enableCloudText?: string; - name?: string; -} - -export const WorkspaceCardSkeleton = () => { - return ( -
A new workspace will be created.
+ ) : ( + <> +Choose a workspace.
+