Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 46 additions & 31 deletions app/[lang]/(marketing)/plugins/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from 'next'
import Link from 'next/link'
import { notFound } from 'next/navigation'
import { ArrowRight, Bot, Boxes, Layers, Radio, Tag } from 'lucide-react'
import { ArrowRight, Bot, Boxes, FileCode2, Layers, Radio, Tag } from 'lucide-react'
import { isAppLocale, type AppLocale } from '@/lib/i18n'
import { getRegistry, REGISTRY_HOST } from '@/lib/registry'
import { pluginsCopy } from '@/lib/plugins-copy'
Expand Down Expand Up @@ -136,39 +136,54 @@ export default async function PluginsPage({ params }: Props) {
</div>
</section>

<section className="mx-auto mb-14 grid w-full max-w-7xl grid-cols-1 gap-4 px-6 lg:grid-cols-5">
<div className="glass-panel min-w-0 rounded-2xl p-6 lg:col-span-3">
<h2 className="mb-1.5 text-lg font-semibold">{t.quickstart.title}</h2>
<p className="mb-4 text-sm text-fd-muted-foreground">{t.quickstart.body}</p>
<section className="mx-auto mb-14 flex w-full max-w-7xl flex-col gap-4 px-6">
<div className="glass-panel grid min-w-0 gap-6 rounded-2xl p-6 lg:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] lg:p-8">
<div className="flex min-w-0 flex-col">
<div className="mb-3 flex h-9 w-9 items-center justify-center rounded-xl bg-fd-primary/10 text-fd-primary">
<FileCode2 size={18} />
</div>
<h2 className="mb-1.5 text-lg font-semibold">{t.quickstart.title}</h2>
<p className="text-sm leading-relaxed text-fd-muted-foreground">{t.quickstart.body}</p>
<Link
href={`${base(lang)}/docs/api-service/client-usage`}
className="mt-4 inline-flex items-center gap-1.5 text-sm font-medium text-fd-primary hover:underline lg:mt-auto"
>
{t.quickstart.docs}
<ArrowRight size={14} />
</Link>
</div>
<CopyBlock code={snippet} label="Copy easyp.yaml" copiedLabel={t.browser.copied} />
<Link
href={`${base(lang)}/docs/api-service/client-usage`}
className="mt-4 inline-flex items-center gap-1.5 text-sm font-medium text-fd-primary hover:underline"
>
{t.quickstart.docs}
<ArrowRight size={14} />
</Link>
</div>
<div className="glass-panel flex min-w-0 flex-col rounded-2xl p-6 lg:col-span-2">
<div className="mb-3 flex h-9 w-9 items-center justify-center rounded-xl bg-fd-primary/10 text-fd-primary">
<Bot size={18} />

<div className="glass-panel grid min-w-0 gap-6 rounded-2xl p-6 lg:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] lg:p-8">
<div className="flex min-w-0 flex-col">
<div className="mb-3 flex h-9 w-9 items-center justify-center rounded-xl bg-fd-primary/10 text-fd-primary">
<Bot size={18} />
</div>
<h2 className="mb-1.5 text-lg font-semibold">{t.quickstart.agents}</h2>
<p className="text-sm leading-relaxed text-fd-muted-foreground">{t.quickstart.agentsBody}</p>
<Link
href={`${base(lang)}/docs/api-service/mcp`}
className="mt-4 inline-flex items-center gap-1.5 text-sm font-medium text-fd-primary hover:underline lg:mt-auto"
>
MCP
<ArrowRight size={14} />
</Link>
</div>
<div className="flex min-w-0 flex-col gap-4">
<div>
<p className="mb-2 text-xs font-medium tracking-wide text-fd-muted-foreground uppercase">MCP endpoint</p>
<CopyBlock code={`https://${REGISTRY_HOST}/mcp`} label="Copy MCP URL" copiedLabel={t.browser.copied} />
</div>
<div>
<p className="mb-2 text-xs font-medium tracking-wide text-fd-muted-foreground uppercase">Claude Code</p>
<CopyBlock
code={`claude mcp add --transport http easyp-plugins https://${REGISTRY_HOST}/mcp`}
label="Copy command"
copiedLabel={t.browser.copied}
/>
</div>
</div>
<h2 className="mb-1.5 text-lg font-semibold">{t.quickstart.agents}</h2>
<p className="mb-4 text-sm text-fd-muted-foreground">{t.quickstart.agentsBody}</p>
<CopyBlock code={`https://${REGISTRY_HOST}/mcp`} label="Copy MCP URL" copiedLabel={t.browser.copied} />
<p className="mt-4 mb-2 text-sm text-fd-muted-foreground">Claude Code:</p>
<CopyBlock
code={`claude mcp add --transport http easyp-plugins https://${REGISTRY_HOST}/mcp`}
label="Copy command"
copiedLabel={t.browser.copied}
/>
<Link
href={`${base(lang)}/docs/api-service/mcp`}
className="mt-auto inline-flex items-center gap-1.5 pt-4 text-sm font-medium text-fd-primary hover:underline"
>
MCP
<ArrowRight size={14} />
</Link>
</div>
</section>

Expand Down
11 changes: 7 additions & 4 deletions components/plugins/copy-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import { useState } from 'react'
import { Check, Copy } from 'lucide-react'

/** A code block with a copy button; `label` names it for screen readers. */
/**
* A code block with a copy button beside it, not on top of it: a long
* command scrolls inside its own column and is never hidden under the button.
*/
export function CopyBlock({ code, label, copiedLabel }: { code: string; label: string; copiedLabel: string }) {
const [copied, setCopied] = useState(false)

Expand All @@ -18,16 +21,16 @@ export function CopyBlock({ code, label, copiedLabel }: { code: string; label: s
}

return (
<div className="group relative">
<pre className="no-scrollbar overflow-x-auto rounded-xl border border-fd-border bg-fd-background/80 py-4 pr-12 pl-4 font-mono text-[13px] leading-relaxed text-fd-foreground">
<div className="flex min-w-0 items-start gap-2 rounded-xl border border-fd-border bg-fd-background/80 py-1.5 pr-1.5 pl-4">
<pre className="no-scrollbar min-w-0 flex-1 overflow-x-auto py-2.5 font-mono text-[13px] leading-relaxed text-fd-foreground">
<code>{code}</code>
</pre>
<button
type="button"
onClick={copy}
aria-label={copied ? copiedLabel : label}
title={copied ? copiedLabel : label}
className="absolute top-2.5 right-2.5 cursor-pointer rounded-lg border border-fd-border bg-fd-card p-1.5 text-fd-muted-foreground opacity-80 transition hover:text-fd-foreground group-hover:opacity-100"
className="mt-1 shrink-0 cursor-pointer rounded-lg border border-fd-border bg-fd-card p-1.5 text-fd-muted-foreground transition-colors hover:border-fd-primary/50 hover:text-fd-foreground"
>
{copied ? <Check size={14} className="text-emerald-400" /> : <Copy size={14} />}
</button>
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins-copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const en = {
title: 'Use it in easyp.yaml',
body: 'Point a plugin at the registry with remote: — pin the version so the output does not move when a newer one is published.',
agents: 'For AI agents',
agentsBody: 'The same listing over MCP, tool plugins_list:',
agentsBody: 'The same listing over MCP, as the plugins_list tool. Connect any agent by URL, or Claude Code with one command.',
docs: 'Client usage docs',
},
browser: {
Expand Down Expand Up @@ -62,7 +62,7 @@ const ru: typeof en = {
title: 'Подключение в easyp.yaml',
body: 'Укажите плагин через remote: и зафиксируйте версию, чтобы результат не менялся, когда выйдет новая.',
agents: 'Для AI-агентов',
agentsBody: 'Тот же список через MCP, инструмент plugins_list:',
agentsBody: 'Тот же список через MCP — инструмент plugins_list. Подключите любого агента по адресу или Claude Code одной командой.',
docs: 'Документация по подключению',
},
browser: {
Expand Down
Loading