settlekit/apps/docs/components/CodeBlock.tsx
caelum0x 598cd03f05 feat: implement all 8 SettleKit apps + fix x402 nonce round-trip
apps:
- api: Hono REST server, all §26 endpoints, 14 tests
- worker: delivery runner + payment-confirm + access-sync + renewal + webhook-retry jobs wired to real package clients
- dashboard: Next.js merchant dashboard, full §16/§27 sections + §28 product builder
- checkout: Next.js hosted USDC checkout with real delivery materialization
- marketplace: Next.js public marketplace + agent metadata.json route
- admin: Next.js risk/ops console wired to @settlekit/risk + database
- docs: Next.js docs site (9 static routes)
- examples: 5 runnable end-to-end examples

fix(x402): support pinned config.nonce so a stateless verifier can confirm
the challenge nonce round-trips (default stays random; package tests intact).

Full workspace: 590 tests passing (122 files), tsc green for all packages +
api/worker/examples, all 5 Next apps typecheck clean, docs next build green.
2026-06-15 10:49:14 +03:00

34 lines
1.1 KiB
TypeScript

/**
* CodeBlock — renders a labelled, monospace code sample.
*
* Server component (no client interactivity needed). The optional `language`
* label sits in the header so readers can tell `ts`, `tsx`, `bash`, and `http`
* samples apart at a glance. Whitespace in `children` is preserved verbatim.
*/
import type { ReactNode } from "react";
export interface CodeBlockProps {
/** The raw source to render. Indentation is preserved as written. */
children: ReactNode;
/** Short language tag shown in the header, e.g. "ts", "tsx", "bash". */
language?: string;
/** Optional filename / caption shown alongside the language tag. */
title?: string;
}
export function CodeBlock({ children, language = "ts", title }: CodeBlockProps) {
return (
<figure className="code-block">
<figcaption className="code-block__head">
{title ? <span className="code-block__title">{title}</span> : null}
<span className="code-block__lang">{language}</span>
</figcaption>
<pre className="code-block__pre">
<code>{children}</code>
</pre>
</figure>
);
}
export default CodeBlock;