import React from 'react'; import { Icon } from '@/components/icon/Icon'; import { Button } from '@/components/ui/button'; import { useI18n } from '@/lib/i18n'; import { useUIStore } from '@/stores/useUIStore'; import { useProjectsStore } from '@/stores/useProjectsStore'; import { WorktreeSectionContent } from '@/components/sections/openchamber/WorktreeSectionContent'; // Full-page worktree management surface for a single project, opened from the // project menu in the sidebar. Renders only the worktree list (setup commands // stay in project settings); the New-worktree action leads the content flow. export function WorktreesView(): React.ReactNode { const { t } = useI18n(); const projectId = useUIStore((state) => state.worktreesPageProjectId); const setNewWorktreeDialogOpen = useUIStore((state) => state.setNewWorktreeDialogOpen); const setActiveProjectIdOnly = useProjectsStore((state) => state.setActiveProjectIdOnly); const project = useProjectsStore((state) => state.projects.find((entry) => entry.id === projectId) ?? null); if (!projectId || !project) return null; return (