diff --git a/apps/harness/src/components/harness-dashboard.tsx b/apps/harness/src/components/harness-dashboard.tsx index cf90283..ad1be1f 100644 --- a/apps/harness/src/components/harness-dashboard.tsx +++ b/apps/harness/src/components/harness-dashboard.tsx @@ -987,92 +987,82 @@ function ProjectsTab({ projects, setProjects, mobile }: { ); }; - const DetailView = () => { - if (creating) { - return ( -
-
- {mobile && setCreating(false)} label="PROJECTS" />} - -
-
-
- - setNewName(e.target.value)} placeholder="My Project" /> -
-
- { setCreating(false); setNewName(""); }}>CANCEL - CREATE PROJECT -
-
+ const detailView = creating ? ( +
+
+ {mobile && setCreating(false)} label="PROJECTS" />} + +
+
+
+ + setNewName(e.target.value)} placeholder="My Project" />
- ); - } - - if (!selectedProject) { - return ( -
- -
- ); - } - - return ( -
-
- {mobile && setSelectedId(null)} label="PROJECTS" />} -
- {selectedProject.name} - handleDelete(selectedProject.id)} style={{ fontSize: tokens.size.xs, minHeight: 32 }}>DELETE PROJECT -
-
- -
- {/* Workspaces list */} -
- -
- {selectedProject.workspaces.length === 0 ? ( - No workspaces configured. Search for a repository below. - ) : ( - selectedProject.workspaces.map(w => ( -
-
- {w.name} - {w.repo} -
- handleRemoveWorkspace(selectedProject.id, w.name)} - style={{ fontSize: tokens.size.xs, minHeight: 32, color: tokens.color.fail, flexShrink: 0 }}> - REMOVE - -
- )) - )} -
-
- - {/* Repo search */} -
- - -
- - - - {/* Credentials management */} - +
+ { setCreating(false); setNewName(""); }}>CANCEL + CREATE PROJECT
- ); - }; +
+ ) : selectedProject ? ( +
+
+ {mobile && setSelectedId(null)} label="PROJECTS" />} +
+ {selectedProject.name} + handleDelete(selectedProject.id)} style={{ fontSize: tokens.size.xs, minHeight: 32 }}>DELETE PROJECT +
+
+ +
+ {/* Workspaces list */} +
+ +
+ {selectedProject.workspaces.length === 0 ? ( + No workspaces configured. Search for a repository below. + ) : ( + selectedProject.workspaces.map(w => ( +
+
+ {w.name} + {w.repo} +
+ handleRemoveWorkspace(selectedProject.id, w.name)} + style={{ fontSize: tokens.size.xs, minHeight: 32, color: tokens.color.fail, flexShrink: 0 }}> + REMOVE + +
+ )) + )} +
+
+ + {/* Repo search */} +
+ + +
+ + + + {/* Credentials management */} + +
+
+ ) : ( +
+ +
+ ); return (
@@ -1090,8 +1080,8 @@ function ProjectsTab({ projects, setProjects, mobile }: {
)} - {!mobile && } - {mobile && showDetail && } + {!mobile && detailView} + {mobile && showDetail && detailView}
); }