- 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>
36 lines
947 B
TypeScript
36 lines
947 B
TypeScript
import { AppShell } from "@/components/layout/app-shell";
|
|
import { query } from "@/lib/db-postgres";
|
|
|
|
async function getProjectName(projectId: string): Promise<string> {
|
|
try {
|
|
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 "Project";
|
|
}
|
|
|
|
export default async function ProjectLayout({
|
|
children,
|
|
params,
|
|
}: {
|
|
children: React.ReactNode;
|
|
params: Promise<{ workspace: string; projectId: string }>;
|
|
}) {
|
|
const { workspace, projectId } = await params;
|
|
const projectName = await getProjectName(projectId);
|
|
|
|
return (
|
|
<AppShell workspace={workspace} projectId={projectId} projectName={projectName}>
|
|
{children}
|
|
</AppShell>
|
|
);
|
|
}
|