Only show start project button in conversations (#6626)

Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
This commit is contained in:
mamoodi 2025-02-06 09:57:54 -05:00 committed by GitHub
parent 8140d2e05a
commit 669e284dc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,5 @@
import { useTranslation } from "react-i18next";
import { useLocation } from "react-router";
import { I18nKey } from "#/i18n/declaration";
import NewProjectIcon from "#/icons/new-project.svg?react";
import { TooltipButton } from "./tooltip-button";
@ -9,7 +10,12 @@ interface ExitProjectButtonProps {
export function ExitProjectButton({ onClick }: ExitProjectButtonProps) {
const { t } = useTranslation();
const location = useLocation();
const startNewProject = t(I18nKey.PROJECT$START_NEW);
// Only show the button in the conversations page
if (!location.pathname.startsWith("/conversations")) return null;
return (
<TooltipButton
tooltip={startNewProject}