refactor: add ChooseWorkspaceView for when no workspace is selected

This commit is contained in:
Haileyesus
2026-04-08 17:40:13 +03:00
parent 3e43431cdb
commit 89b0067478
2 changed files with 26 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ import GitPanelRouterAdapter from '@/components/git-panel/view/GitPanelRouterAda
import { TaskMasterPanel } from '@/components/task-master/index.js';
import PluginContentRouterAdapter from '@/components/plugins/view/PluginContentRouterAdapter.js';
import ChatInterface from '@/components/refactored/chat/view/ChatInterface.js';
import ChooseWorkspaceView from '@/components/refactored/shared/view/ChooseWorkspaceView.js';
const isValidRouteTab = (value: string | undefined): boolean => {
if (!value) {
@@ -116,7 +117,7 @@ const router = createBrowserRouter(
path: '/',
element: <RootLayout />,
children: [
{ index: true, element: <NoWorkspaceRoute /> }, // TODO: Show empty state component loader here.
{ index: true, element: <ChooseWorkspaceView /> }, // TODO: Show empty state component loader here.
{
path: 'workspaces/:workspaceId',
element: <WorkspaceLayout />,

View File

@@ -0,0 +1,24 @@
import { t } from "i18next";
import { Folder } from "lucide-react";
import { useDeviceSettings } from "@/hooks/useDeviceSettings.js";
export default function ChooseProjectView() {
const { isMobile } = useDeviceSettings();
return (
<div className="flex flex-1 items-center justify-center">
<div className="mx-auto max-w-md px-6 text-center">
<div className="mx-auto mb-5 flex h-14 w-14 items-center justify-center rounded-2xl bg-muted/50">
<Folder className="h-7 w-7 text-muted-foreground" />
</div>
<h2 className="mb-2 text-xl font-semibold text-foreground">{t('mainContent.chooseProject')}</h2>
<p className="mb-5 text-sm leading-relaxed text-muted-foreground">{t('mainContent.selectProjectDescription')}</p>
<div className="rounded-xl border border-primary/10 bg-primary/5 p-3.5">
<p className="text-sm text-primary">
<strong>{t('mainContent.tip')}:</strong> {isMobile ? t('mainContent.createProjectMobile') : t('mainContent.createProjectDesktop')}
</p>
</div>
</div>
</div>
)
}