mirror of
https://github.com/hanzo-apps/hanzo.ai.git
synced 2026-10-30 14:58:08 +00:00
Pages from /machines to /risk, the model pages, and the kits they are made of
(page-kit, ProductLanding, LayerPage, Stack, the models kit, band's Head) mark
authored copy where it is written and draw it in the reader's language. A server
page marks a literal phrase('…') or wraps it in <T>; a client page calls t. The
kits translate a string prop through useSay (components/marketing/say), so a
page passes phrase('…') and markup passes as written. An arrow that points
turns over right to left (data-i18n-mirror).
Rebased on main: the fold-based heroes (Fold, PageHero, MachinesHero, the
product and layer pages) keep main's structure and copy, with their label,
title and lede marked phrase. /platform is main's CloudLanding; the deleted
/platform/layers and the old referral components stay deleted.
Claude-Session: https://claude.ai/code/session_015XYKLjZtDTJEnMo4eK3AFH
28 lines
1.0 KiB
TypeScript
28 lines
1.0 KiB
TypeScript
import { Code } from '@/components/code'
|
|
import Playground from './view'
|
|
import { phrase } from '@hanzo/i18n'
|
|
|
|
const EXAMPLES = [
|
|
{ lang: 'curl', label: phrase('One request'), code: `curl https://api.hanzo.ai/v1/chat/completions \\
|
|
-H "Authorization: Bearer $HANZO_API_KEY" \\
|
|
-d '{"model":"zen","messages":[{"role":"user","content":"Hello"}]}'` },
|
|
{ lang: 'python', label: phrase('The Python client'), code: `pip install hanzoai
|
|
|
|
import os
|
|
from hanzoai.cloud import ApiClient, Configuration, KeysApi
|
|
|
|
api = ApiClient(Configuration(
|
|
host="https://api.hanzo.ai",
|
|
access_token=os.environ["HANZO_API_KEY"],
|
|
))
|
|
print(KeysApi(api).get_keys().keys)` },
|
|
]
|
|
|
|
/** The grammar each starter's language label is written in. */
|
|
const GRAMMAR: Record<string, string> = { curl: 'bash', python: 'python' }
|
|
|
|
/** The page, with its starters highlighted where they are built (components/code). */
|
|
export default function Page() {
|
|
return <Playground examples={EXAMPLES.map((e) => ({ ...e, code: <Code lang={GRAMMAR[e.lang]} code={e.code} /> }))} />
|
|
}
|