feat: update project dashboard UI for Vibn architecture
- project layout.tsx: replace Firebase Admin SDK with direct Postgres query to resolve project name; removes firebase/admin dependency - overview page: full rewrite — fetches from /api/projects/:id, shows Gitea repo + last commit, branch, clone URLs; deployment status badge; open PRs and issues from contextSnapshot; recent commits list; resources section; Open IDE button; context freshness timestamp - projects list page: cards now show Gitea repo + last commit inline, deploy status dot, IDE quick-link; updated empty state copy to reflect auto-provisioning; removed Firebase imports Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,18 +1,20 @@
|
||||
import { AppShell } from "@/components/layout/app-shell";
|
||||
import { getAdminDb } from "@/lib/firebase/admin";
|
||||
import { query } from "@/lib/db-postgres";
|
||||
|
||||
async function getProjectName(projectId: string): Promise<string> {
|
||||
try {
|
||||
const adminDb = getAdminDb();
|
||||
const projectDoc = await adminDb.collection('projects').doc(projectId).get();
|
||||
if (projectDoc.exists) {
|
||||
const data = projectDoc.data();
|
||||
return data?.productName || data?.name || "Product";
|
||||
const rows = await query<{ data: any }>(
|
||||
`SELECT data FROM fs_projects WHERE id = $1 LIMIT 1`,
|
||||
[projectId]
|
||||
);
|
||||
if (rows.length > 0) {
|
||||
const data = rows[0].data;
|
||||
return data?.productName || data?.name || "Project";
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching project name:", error);
|
||||
}
|
||||
return "Product";
|
||||
return "Project";
|
||||
}
|
||||
|
||||
export default async function ProjectLayout({
|
||||
@@ -24,11 +26,10 @@ export default async function ProjectLayout({
|
||||
}) {
|
||||
const { workspace, projectId } = await params;
|
||||
const projectName = await getProjectName(projectId);
|
||||
|
||||
|
||||
return (
|
||||
<AppShell workspace={workspace} projectId={projectId} projectName={projectName}>
|
||||
{children}
|
||||
</AppShell>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user