/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import { observer } from "mobx-react"; // plane internal packages import { WEB_BASE_URL } from "@plane/constants"; import { NewTabIcon } from "@plane/propel/icons"; import { Tooltip } from "@plane/propel/tooltip"; import { getFileURL } from "@plane/utils"; // hooks import { useWorkspace } from "@/hooks/store"; type TWorkspaceListItemProps = { workspaceId: string; }; export const WorkspaceListItem = observer(function WorkspaceListItem({ workspaceId }: TWorkspaceListItemProps) { // store hooks const { getWorkspaceById } = useWorkspace(); // derived values const workspace = getWorkspaceById(workspaceId); if (!workspace) return null; return (
{workspace?.logo_url && workspace.logo_url !== "" ? ( Workspace Logo ) : ( (workspace?.name?.[0] ?? "...") )}

{workspace.name}

/

[{workspace.slug}]

{workspace.owner.email && (

Owned by:

{workspace.owner.email}

)}
{workspace.total_projects !== null && (

Total projects:

{workspace.total_projects}

)} {workspace.total_members !== null && ( <> •

Total members:

{workspace.total_members}

)}
); });