diff --git a/src/components/ProjectTitleMenu.tsx b/src/components/ProjectTitleMenu.tsx new file mode 100644 index 00000000..a6de03b2 --- /dev/null +++ b/src/components/ProjectTitleMenu.tsx @@ -0,0 +1,115 @@ +import { useTranslation } from 'react-i18next'; +import { Button } from '@/components/ui/button'; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from '@/components/ui/dropdown-menu'; +import { + GitBranch, + MessageSquarePlus, + History, + Folder, + Rocket, + Copy, + ChevronDown, +} from 'lucide-react'; +import { cn } from '@/lib/utils'; + +interface ProjectTitleMenuProps { + projectName: string; + onNewChat: () => void; + onGitHistory: () => void; + onGitDialog: () => void; + onDeploy: () => void; + onDuplicate: () => void; + onProjectDetails: () => void; + isAILoading: boolean; + isAnyLoading: boolean; + className?: string; +} + +export function ProjectTitleMenu({ + projectName, + onNewChat, + onGitHistory, + onGitDialog, + onDeploy, + onDuplicate, + onProjectDetails, + isAILoading, + isAnyLoading, + className = '', +}: ProjectTitleMenuProps) { + const { t } = useTranslation(); + + return ( + + + + + + + + New Chat + + + + + Rollback + + + + + Repository + + + + + Deploy + + + + + {t('duplicateProject')} + + + + + Project Details + + + + ); +} diff --git a/src/components/ui/command.tsx b/src/components/ui/command.tsx index 69d63a47..9b6d9ac5 100644 --- a/src/components/ui/command.tsx +++ b/src/components/ui/command.tsx @@ -115,7 +115,7 @@ const CommandItem = React.forwardRef< ('chat'); const [isAILoading, setIsAILoading] = useState(false); const [isProjectDetailsOpen, setIsProjectDetailsOpen] = useState(false); + const [gitHistoryOpen, setGitHistoryOpen] = useState(false); + const [gitDialogOpen, setGitDialogOpen] = useState(false); + const [deployDialogOpen, setDeployDialogOpen] = useState(false); + const [duplicateDialogOpen, setDuplicateDialogOpen] = useState(false); // Use console error state from provider const { consoleError, dismissConsoleError, clearErrors } = useConsoleError(); @@ -120,6 +128,8 @@ export function ProjectView() { navigate('/'); }; + const isAnyLoading = isAILoading || build.isPending; + if (!project && !isLoading) { return (
@@ -149,13 +159,18 @@ export function ProjectView() {
{project ? ( - + setGitHistoryOpen(true)} + onGitDialog={() => setGitDialogOpen(true)} + onDeploy={() => setDeployDialogOpen(true)} + onDuplicate={() => setDuplicateDialogOpen(true)} + onProjectDetails={() => setIsProjectDetailsOpen(true)} + isAILoading={isAILoading} + isAnyLoading={isAnyLoading} + className="text-sm" + /> ) : ( )} @@ -164,27 +179,13 @@ export function ProjectView() {
{project ? ( - <> - - setIsProjectDetailsOpen(true)} - isLoading={isAILoading} - isBuildLoading={build.isPending} - onFirstInteraction={handleFirstInteraction} - /> - + ) : ( - <> - - - + )}
@@ -298,14 +299,38 @@ export function ProjectView() {
- {/* Project Details Dialog */} + {/* Dialogs */} {project && ( - + <> + + + + + + )} ); @@ -357,43 +382,34 @@ export function ProjectView() { {/* Project title */}
{project ? ( - + setGitHistoryOpen(true)} + onGitDialog={() => setGitDialogOpen(true)} + onDeploy={() => setDeployDialogOpen(true)} + onDuplicate={() => setDuplicateDialogOpen(true)} + onProjectDetails={() => setIsProjectDetailsOpen(true)} + isAILoading={isAILoading} + isAnyLoading={isAnyLoading} + className="text-lg" + /> ) : ( )}
- {/* Right side - Star and Actions Menu */} + {/* Right side - Star button only */}
{project ? ( - <> - - setIsProjectDetailsOpen(true)} - isLoading={isAILoading} - isBuildLoading={build.isPending} - onFirstInteraction={handleFirstInteraction} - /> - + ) : ( - <> - - - + )}
@@ -452,14 +468,38 @@ export function ProjectView() { - {/* Project Details Dialog */} + {/* Dialogs */} {project && ( - + <> + + + + + + )} );