peppa/apps/web/app/(app)/help/connect/page.tsx
2026-11-16 09:04:45 +05:00

69 lines
2.8 KiB
TypeScript

import Link from "next/link";
import { CONNECT_HELP } from "@peppa/core";
import { PageHeader } from "@/components/common";
import { CopyText } from "@/components/CopyText";
import { Workspace } from "@/components/Workspace";
import { publicOrigin } from "@/lib/auth";
import { getLocale } from "@/lib/i18n";
/** PEP-135: how to connect Peppa FACTORY to one's own Claude or ChatGPT — step by step; texts live in core/connect-texts.ts. */
export default async function ConnectHelp() {
const t = CONNECT_HELP[await getLocale()] ?? CONNECT_HELP.ru;
const address = `${await publicOrigin()}/mcp`;
const card = "flex flex-col gap-2 rounded-lg border bg-card px-4 py-3";
const h2 = "m-0 text-[15px] font-semibold";
return (
<Workspace>
<div className="max-w-2xl text-sm leading-relaxed">
<PageHeader crumbs={<Link href="/help" className="text-muted-foreground hover:text-foreground">{t.back}</Link>} title={t.title}>
{t.lead}
</PageHeader>
<div className="flex flex-col gap-3">
<section className={card}>
<h2 className={h2}>{t.addressTitle}</h2>
<CopyText value={address} label={t.copy} done={t.copied} />
<p className="m-0 text-muted-foreground">{t.addressNote}</p>
</section>
{t.apps.map((app) => (
<section key={app.id} id={app.id} className={card}>
<h2 className={h2}>{app.title}</h2>
<p className="m-0 text-muted-foreground">{app.need}</p>
<ol className="m-0 flex list-decimal flex-col gap-1.5 pl-5">
{app.steps.map((s) => (
<li key={s}>{s}</li>
))}
</ol>
</section>
))}
<section className={card}>
<h2 className={h2}>{t.askTitle}</h2>
<p className="m-0 text-muted-foreground">{t.askLead}</p>
<ul className="m-0 flex list-none flex-col gap-1.5 p-0">
{t.asks.map((a) => (
<li key={a} className="rounded-md border bg-muted/50 px-3 py-1.5">{a}</li>
))}
</ul>
</section>
<section className={card}>
<h2 className={h2}>{t.troubleTitle}</h2>
<dl className="m-0 flex flex-col gap-2">
{t.troubles.map((x) => (
<div key={x.q}>
<dt className="font-medium">{x.q}</dt>
<dd className="m-0 text-muted-foreground">{x.a}</dd>
</div>
))}
</dl>
</section>
<section className={card}>
<h2 className={h2}>{t.offTitle}</h2>
<p className="m-0">{t.off}</p>
<Link href="/settings#apps" className="text-primary">{t.offLink}</Link>
</section>
</div>
<p className="mt-4 mb-0 text-muted-foreground">{t.other}</p>
</div>
</Workspace>
);
}