diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index 441d137..5c37b63 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -5,6 +5,7 @@ import { AppShell } from "@/components/AppShell"; import { BackendDownNotice } from "@/components/BackendDownNotice"; import { ProjectLibrary } from "@/components/projects/ProjectLibrary"; import { EmptyState } from "@/components/ui/EmptyState"; +import { PageContainer } from "@/components/ui/PageContainer"; import { PageHeader } from "@/components/ui/PageHeader"; import { fetchProjects } from "@/lib/api/server"; import type { ProjectResponse } from "@/lib/api/types"; @@ -23,7 +24,7 @@ export default async function DashboardPage() { return ( -
+ )} -
+
); } diff --git a/apps/web/components/ui/PageContainer.tsx b/apps/web/components/ui/PageContainer.tsx new file mode 100644 index 0000000..7440043 --- /dev/null +++ b/apps/web/components/ui/PageContainer.tsx @@ -0,0 +1,30 @@ +import type { ReactNode } from "react"; + +import { cn } from "@/lib/ui/variants"; + +export type PageWidth = "prose" | "default" | "wide"; + +const widths: Record = { + prose: "max-w-3xl", + default: "max-w-5xl", + wide: "max-w-6xl", +}; + +interface PageContainerProps { + children: ReactNode; + width?: PageWidth; + className?: string; +} + +// 统一页容器:居中 + 一致的最大宽度与内边距节奏(替换各页手写的 mx-auto max-w-* px-6 py-10)。 +export function PageContainer({ + children, + width = "default", + className, +}: PageContainerProps) { + return ( +
+ {children} +
+ ); +}