feat(web): add Server Component entry pages for / and /users
This commit is contained in:
parent
7b97e593e5
commit
c0749d1af0
@ -1,78 +1,9 @@
|
|||||||
export default function Home() {
|
import { getAccounts } from "@/lib/api";
|
||||||
const hazardStripe = {
|
import AccountsTable from "@/components/accounts-table";
|
||||||
backgroundImage:
|
|
||||||
"repeating-linear-gradient(45deg, #facc15 0 24px, #18181b 24px 48px)",
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
const PREFIX_PATTERN = process.env.NEXT_PUBLIC_CM_PREFIX_PATTERN ?? "13c";
|
||||||
<main className="min-h-screen bg-white font-mono text-black">
|
|
||||||
{/* Top hazard stripe */}
|
|
||||||
<div className="h-6 w-full" style={hazardStripe} aria-hidden="true" />
|
|
||||||
|
|
||||||
<div className="mx-auto max-w-3xl px-6 py-16 sm:py-24">
|
export default async function AccountsPage() {
|
||||||
{/* Status pill */}
|
const accounts = await getAccounts();
|
||||||
<div className="mb-10 inline-flex items-center gap-2 border-2 border-black bg-yellow-300 px-3 py-1.5 text-[11px] font-black uppercase tracking-[0.2em] text-black">
|
return <AccountsTable initial={accounts} prefixPattern={PREFIX_PATTERN} />;
|
||||||
<span className="h-1.5 w-1.5 bg-black" aria-hidden="true" />
|
|
||||||
Status: Scaffold
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Headline */}
|
|
||||||
<h1 className="text-5xl font-black uppercase tracking-tight text-black sm:text-7xl">
|
|
||||||
CM Bot V2
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
{/* Subhead */}
|
|
||||||
<div className="mt-4 flex items-baseline gap-3">
|
|
||||||
<span className="text-xs font-bold uppercase tracking-[0.2em] text-zinc-400">
|
|
||||||
//
|
|
||||||
</span>
|
|
||||||
<p className="text-sm font-bold uppercase tracking-[0.2em] text-zinc-700 sm:text-base">
|
|
||||||
cm-web-next scaffold
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Notice */}
|
|
||||||
<div className="mt-14 border-2 border-black bg-white p-6 sm:p-8">
|
|
||||||
<div className="mb-3 text-[10px] font-black uppercase tracking-[0.25em] text-zinc-400">
|
|
||||||
Notice
|
|
||||||
</div>
|
|
||||||
<p className="text-base sm:text-xl">
|
|
||||||
This is a placeholder. The real dashboard lands in{" "}
|
|
||||||
<span className="bg-yellow-300 px-1.5 font-black">B2</span>.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Architecture note */}
|
|
||||||
<div className="mt-6 border-2 border-dashed border-black/50 bg-zinc-50 p-6 sm:p-8">
|
|
||||||
<div className="mb-4 text-[10px] font-black uppercase tracking-[0.25em] text-zinc-400">
|
|
||||||
Architecture
|
|
||||||
</div>
|
|
||||||
<p className="text-sm text-zinc-800 sm:text-base">
|
|
||||||
No public{" "}
|
|
||||||
<code className="bg-black px-1.5 py-0.5 font-mono text-xs text-yellow-300">
|
|
||||||
/api
|
|
||||||
</code>{" "}
|
|
||||||
surface. Reads come from{" "}
|
|
||||||
<span className="font-bold">React Server Components</span> fetching{" "}
|
|
||||||
<code className="bg-black px-1.5 py-0.5 font-mono text-xs text-yellow-300">
|
|
||||||
api-server:3000
|
|
||||||
</code>{" "}
|
|
||||||
inside the docker network; mutations go through{" "}
|
|
||||||
<span className="font-bold">Server Actions</span>. The browser
|
|
||||||
never calls a JSON endpoint.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Footer marker */}
|
|
||||||
<div className="mt-20 flex items-center gap-4 text-[10px] font-black uppercase tracking-[0.25em] text-zinc-500">
|
|
||||||
<span>B1</span>
|
|
||||||
<span className="h-px flex-1 bg-zinc-300" aria-hidden="true" />
|
|
||||||
<span>not for production</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Bottom hazard stripe */}
|
|
||||||
<div className="h-6 w-full" style={hazardStripe} aria-hidden="true" />
|
|
||||||
</main>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
9
web/app/users/page.tsx
Normal file
9
web/app/users/page.tsx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { getUsers } from "@/lib/api";
|
||||||
|
import UsersTable from "@/components/users-table";
|
||||||
|
|
||||||
|
const PREFIX_PATTERN = process.env.NEXT_PUBLIC_CM_PREFIX_PATTERN ?? "13c";
|
||||||
|
|
||||||
|
export default async function UsersPage() {
|
||||||
|
const users = await getUsers();
|
||||||
|
return <UsersTable initial={users} prefixPattern={PREFIX_PATTERN} />;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user