Files
beaver_project/app-instance/frontend/app/(app)/help/page.tsx
2026-03-13 16:40:08 +08:00

169 lines
8.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use client';
import React, { useState } from 'react';
import {
MessageSquare,
Terminal,
Layers,
Wifi,
WifiOff,
Plus,
Trash2,
Send,
ChevronDown,
ChevronRight,
} from 'lucide-react';
interface SectionProps {
icon: React.ReactNode;
title: string;
children: React.ReactNode;
defaultOpen?: boolean;
}
function Section({ icon, title, children, defaultOpen = false }: SectionProps) {
const [open, setOpen] = useState(defaultOpen);
return (
<div className="border border-border rounded-lg overflow-hidden">
<button
className="w-full flex items-center gap-3 px-4 py-3 bg-card hover:bg-accent/50 transition-colors text-left"
onClick={() => setOpen((v) => !v)}
>
<span className="text-primary">{icon}</span>
<span className="font-medium flex-1">{title}</span>
{open ? <ChevronDown className="w-4 h-4 text-muted-foreground" /> : <ChevronRight className="w-4 h-4 text-muted-foreground" />}
</button>
{open && (
<div className="px-4 py-4 space-y-3 text-sm text-muted-foreground border-t border-border bg-background">
{children}
</div>
)}
</div>
);
}
function Tag({ children, color = 'default' }: { children: React.ReactNode; color?: 'green' | 'yellow' | 'red' | 'default' }) {
const cls = {
green: 'bg-green-900/30 text-green-400 border-green-800',
yellow: 'bg-yellow-900/30 text-yellow-400 border-yellow-800',
red: 'bg-red-900/30 text-red-400 border-red-800',
default: 'bg-muted text-foreground border-border',
}[color];
return (
<span className={`inline-block px-2 py-0.5 rounded border text-xs font-mono ${cls}`}>
{children}
</span>
);
}
export default function HelpPage() {
return (
<div className="max-w-2xl mx-auto px-4 py-8 space-y-4">
<div className="mb-6">
<h1 className="text-2xl font-bold mb-1">使</h1>
<p className="text-muted-foreground text-sm">使 Boardware Genius </p>
</div>
<Section icon={<MessageSquare className="w-5 h-5" />} title="如何开始对话" defaultOpen>
<p><strong className="text-foreground"></strong><strong className="text-foreground"></strong></p>
<ol className="list-decimal list-inside space-y-1.5 ml-1">
<li></li>
<li> <Tag>Enter</Tag> <Tag>Shift + Enter</Tag> </li>
<li> Boardware Genius "思考中..."</li>
</ol>
<p className="mt-1">
<Tag></Tag>
</p>
</Section>
<Section icon={<Terminal className="w-5 h-5" />} title="斜杠命令(/命令)">
<p> <Tag>/</Tag> </p>
<ul className="space-y-1.5 ml-1">
<li> <Tag>/</Tag> </li>
<li> <Tag></Tag> <Tag></Tag> </li>
<li> <Tag>Enter</Tag> <Tag>Tab</Tag> </li>
<li> <Tag>Esc</Tag> </li>
</ul>
<p><strong className="text-foreground"></strong><strong className="text-foreground"></strong></p>
</Section>
<Section icon={<Layers className="w-5 h-5" />} title="对话管理">
<ul className="space-y-2 ml-1">
<li>
<span className="inline-flex items-center gap-1"><Plus className="w-3.5 h-3.5" /><strong className="text-foreground"></strong></span>
{' '}
</li>
<li>
<span className="inline-flex items-center gap-1"><MessageSquare className="w-3.5 h-3.5" /><strong className="text-foreground"></strong></span>
{' '}
</li>
<li>
<span className="inline-flex items-center gap-1"><Trash2 className="w-3.5 h-3.5" /><strong className="text-foreground"></strong></span>
{' '}
</li>
</ul>
<p className="text-xs mt-1 text-muted-foreground/70"></p>
</Section>
<Section icon={<Wifi className="w-5 h-5" />} title="连接状态说明">
<p></p>
<div className="space-y-2 ml-1 mt-2">
<div className="flex items-center gap-2">
<span className="w-2 h-2 rounded-full bg-green-500 flex-shrink-0" />
<Tag color="green"></Tag>
<span> Boardware Genius </span>
</div>
<div className="flex items-center gap-2">
<span className="w-2 h-2 rounded-full bg-yellow-500 flex-shrink-0" />
<Tag color="yellow"> / </Tag>
<span> </span>
</div>
<div className="flex items-center gap-2">
<span className="w-2 h-2 rounded-full bg-red-500 flex-shrink-0" />
<Tag color="red">线</Tag>
<span> Boardware Genius </span>
</div>
<div className="flex items-center gap-2">
<span className="w-2 h-2 rounded-full bg-red-500 flex-shrink-0" />
<Tag color="red"></Tag>
<span> </span>
</div>
</div>
<p className="mt-3 text-xs">
<strong className="text-foreground"></strong>"服务离线"
</p>
</Section>
<Section icon={<Send className="w-5 h-5" />} title="输入技巧">
<ul className="space-y-2 ml-1">
<li><Tag>Enter</Tag> </li>
<li><Tag>Shift + Enter</Tag> </li>
<li>使 Enter Enter </li>
<li> <Tag>/</Tag> </li>
</ul>
</Section>
<Section icon={<WifiOff className="w-5 h-5" />} title="常见问题">
<div className="space-y-4">
<div>
<p className="font-medium text-foreground mb-1">Q</p>
<p>"已连接""服务离线""未连接"</p>
</div>
<div>
<p className="font-medium text-foreground mb-1">Q Boardware Genius </p>
<p><strong className="text-foreground"></strong>AI </p>
</div>
<div>
<p className="font-medium text-foreground mb-1">Q使</p>
<p><strong className="text-foreground"></strong></p>
</div>
<div>
<p className="font-medium text-foreground mb-1">Q</p>
<p><strong className="text-foreground"></strong> Boardware Genius <strong className="text-foreground"></strong> Agent </p>
</div>
</div>
</Section>
</div>
);
}