返回 CodeWhale
page.tsx
根目录 / web / app / [locale] / docs / troubleshooting / page.tsx
1 import { getDocsTroubleshooting } from "@/lib/i18n/dictionaries";
2 import { buildPageMetadata } from "@/lib/page-meta";
3
4 export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }) {
5 const { locale } = await params;
6 const t = getDocsTroubleshooting(locale);
7 return buildPageMetadata({
8 path: "/docs/troubleshooting",
9 locale,
10 title: t.metaTitle,
11 description: t.metaDescription,
12 });
13 }
14
15 export default async function TroubleshootingPage({
16 params,
17 }: {
18 params: Promise<{ locale: string }>;
19 }) {
20 const { locale } = await params;
21 const t = getDocsTroubleshooting(locale);
22
23 return (
24 <section className="space-y-10">
25 <section id="overview" className="scroll-mt-32">
26 <h1 className="font-display text-3xl mb-1">{t.overviewTitle}</h1>
27 <p className={`${t.bodyClassName} mt-3`}>{t.overviewLead}</p>
28 <div className="hairline-t mt-6">
29 {t.incidents.map(([name, detail]) => (
30 <section key={name} className="py-4 hairline-b">
31 <h3 className="font-display text-lg">{name}</h3>
32 <p className={`${t.bodyClassName} mt-1 text-sm`}>{detail}</p>
33 </section>
34 ))}
35 </div>
36 </section>
37
38 <section id="docker" className="scroll-mt-32">
39 <h2 className="font-display text-2xl mb-1">{t.dockerTitle}</h2>
40 <p className={`${t.bodyClassName} mt-3`}>{t.dockerLead}</p>
41 <pre className="code-block mt-4">{`docker volume create codewhale-home
42
43 docker run --rm -it \\
44 -e DEEPSEEK_API_KEY="your-api-key-here" \\
45 -v codewhale-home:/home/codewhale/.codewhale \\
46 -v "$PWD:/workspace" \\
47 -w /workspace \\
48 ghcr.io/hmbown/codewhale:latest`}</pre>
49 <p className={`${t.bodyClassName} mt-3`}>{t.dockerToolboxNote}</p>
50 </section>
51
52 <section id="source" className="hairline-t pt-8">
53 <p className="text-sm text-ink-mute">{t.sourceNote}</p>
54 </section>
55 </section>
56 );
57 }
58
58 lines Plain Text