import { FC } from "react"; import useSWR from "swr"; import { useRouter } from "next/router"; import Link from "next/link"; // ui import { BreadcrumbItem, Breadcrumbs } from "@plane/ui"; // hooks import { observer } from "mobx-react-lite"; // services import { WorkspaceService } from "services/workspace.service"; // helpers import { truncateText } from "helpers/string.helper"; // constant import { WORKSPACE_DETAILS } from "constants/fetch-keys"; const workspaceService = new WorkspaceService(); export interface IWorkspaceSettingHeader { title: string; } export const WorkspaceSettingHeader: FC = observer((props) => { const { title } = props; const router = useRouter(); const { workspaceSlug } = router.query; const { data: activeWorkspace } = useSWR(workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null, () => workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null ); return (
router.back()}>

{`${truncateText(activeWorkspace?.name ?? "Workspace", 32)}`}

} />
); });