Files
chinese-family-tree-2/app/help/page.tsx
T
freedakgmail fd9c064749 0.3.0.0
2025-11-30 09:16:43 +08:00

334 lines
16 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 { useEffect } from "react"
import { useSession } from "next-auth/react"
import { useRouter } from "next/navigation"
import { SiteHeader } from "@/components/site-header"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
import { Button } from "@/components/ui/button"
import { BookOpen, Users, Network, Settings, Shield, FileText } from "lucide-react"
export default function HelpPage() {
const { data: session, status, update } = useSession()
const router = useRouter()
useEffect(() => {
if (status !== "authenticated") return
if (session?.user?.hasSeenHelp) return
const markHelpSeen = async () => {
try {
const response = await fetch("/api/users/me/seen-help", {
method: "PATCH",
})
if (!response.ok) {
throw new Error("failed to update help status")
}
await update({ user: { hasSeenHelp: true } })
} catch (error) {
console.error("标记使用帮助状态失败:", error)
}
}
markHelpSeen()
}, [status, session?.user?.hasSeenHelp, update])
return (
<div className="h-screen flex flex-col bg-background">
<SiteHeader />
<main className="flex-1 overflow-y-auto">
<div className="container mx-auto px-4 py-8">
<div className="max-w-5xl mx-auto space-y-8">
{/* 标题 */}
<div>
<h1 className="text-3xl font-serif font-bold mb-2">使</h1>
<p className="text-muted-foreground">
使
</p>
<div className="mt-4">
<Button onClick={() => router.replace("/")} size="lg">
</Button>
</div>
</div>
<Tabs defaultValue="guide" className="space-y-6">
<TabsList className="grid w-full grid-cols-3">
<TabsTrigger value="guide"></TabsTrigger>
<TabsTrigger value="roles"></TabsTrigger>
<TabsTrigger value="features"></TabsTrigger>
</TabsList>
{/* 快速入门 */}
<TabsContent value="guide" className="space-y-6">
<Card className="border-none shadow-sm bg-card/50 backdrop-blur">
<CardHeader>
<div className="flex items-center gap-3">
<div className="flex h-12 w-12 items-center justify-center rounded-full bg-primary/10 text-primary">
<BookOpen className="h-6 w-6" />
</div>
<div>
<CardTitle className="text-xl font-serif font-light">使</CardTitle>
<CardDescription className="font-light"></CardDescription>
</div>
</div>
</CardHeader>
<CardContent className="space-y-6">
<div className="space-y-4">
<div className="flex gap-4">
<div className="flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold">
1
</div>
<div className="flex-1">
<h3 className="font-medium mb-1"></h3>
<p className="text-sm text-muted-foreground font-light">
使
</p>
</div>
</div>
<div className="flex gap-4">
<div className="flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold">
2
</div>
<div className="flex-1">
<h3 className="font-medium mb-1"></h3>
<p className="text-sm text-muted-foreground font-light">
"开始记录"
</p>
</div>
</div>
<div className="flex gap-4">
<div className="flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold">
3
</div>
<div className="flex-1">
<h3 className="font-medium mb-1"></h3>
<p className="text-sm text-muted-foreground font-light">
</p>
</div>
</div>
<div className="flex gap-4">
<div className="flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold">
4
</div>
<div className="flex-1">
<h3 className="font-medium mb-1"></h3>
<p className="text-sm text-muted-foreground font-light">
</p>
</div>
</div>
<div className="flex gap-4">
<div className="flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold">
5
</div>
<div className="flex-1">
<h3 className="font-medium mb-1"></h3>
<p className="text-sm text-muted-foreground font-light">
</p>
</div>
</div>
<div className="flex gap-4">
<div className="flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold">
6
</div>
<div className="flex-1">
<h3 className="font-medium mb-1"></h3>
<p className="text-sm text-muted-foreground font-light">
</p>
</div>
</div>
</div>
</CardContent>
</Card>
<Card className="border-none shadow-sm bg-card/50 backdrop-blur">
<CardHeader>
<CardTitle className="text-xl font-serif font-light"></CardTitle>
</CardHeader>
<CardContent>
<ul className="space-y-2 text-sm text-muted-foreground font-light">
<li> </li>
<li> 便</li>
<li> 使</li>
<li> 使</li>
<li> "编辑者"</li>
</ul>
</CardContent>
</Card>
</TabsContent>
{/* 角色权限 */}
<TabsContent value="roles" className="space-y-6">
<Card className="border-none shadow-sm bg-card/50 backdrop-blur">
<CardHeader>
<div className="flex items-center gap-3">
<div className="flex h-12 w-12 items-center justify-center rounded-full bg-primary/10 text-primary">
<Shield className="h-6 w-6" />
</div>
<div>
<CardTitle className="text-xl font-serif font-light"></CardTitle>
<CardDescription className="font-light"></CardDescription>
</div>
</div>
</CardHeader>
<CardContent className="space-y-6">
<div className="space-y-6">
<div className="p-4 bg-primary/5 rounded-lg">
<div className="flex items-center gap-2 mb-2">
<div className="w-2 h-2 rounded-full bg-primary"></div>
<h3 className="font-medium"></h3>
</div>
<p className="text-sm text-muted-foreground font-light mb-3">
</p>
<div className="space-y-1 text-sm">
<p className="text-muted-foreground font-light"> </p>
<p className="text-muted-foreground font-light"> </p>
<p className="text-muted-foreground font-light"> </p>
<p className="text-muted-foreground font-light"> </p>
<p className="text-muted-foreground font-light"> </p>
</div>
</div>
<div className="p-4 bg-muted/30 rounded-lg">
<div className="flex items-center gap-2 mb-2">
<div className="w-2 h-2 rounded-full bg-blue-500"></div>
<h3 className="font-medium"></h3>
</div>
<p className="text-sm text-muted-foreground font-light mb-3">
</p>
<div className="space-y-1 text-sm">
<p className="text-muted-foreground font-light"> </p>
<p className="text-muted-foreground font-light"> </p>
<p className="text-muted-foreground font-light"> </p>
<p className="text-muted-foreground font-light"> </p>
<p className="text-muted-foreground font-light"> </p>
</div>
</div>
<div className="p-4 bg-muted/30 rounded-lg">
<div className="flex items-center gap-2 mb-2">
<div className="w-2 h-2 rounded-full bg-green-500"></div>
<h3 className="font-medium"></h3>
</div>
<p className="text-sm text-muted-foreground font-light mb-3">
</p>
<div className="space-y-1 text-sm">
<p className="text-muted-foreground font-light"> </p>
<p className="text-muted-foreground font-light"> </p>
<p className="text-muted-foreground font-light"> </p>
<p className="text-muted-foreground font-light"> </p>
<p className="text-muted-foreground font-light"> </p>
</div>
</div>
</div>
</CardContent>
</Card>
</TabsContent>
{/* 功能说明 */}
<TabsContent value="features" className="space-y-6">
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<Card className="border-none shadow-sm bg-card/50 backdrop-blur">
<CardHeader>
<div className="flex items-center gap-3">
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-primary/10 text-primary">
<Users className="h-5 w-5" />
</div>
<CardTitle className="text-lg font-serif font-light"></CardTitle>
</div>
</CardHeader>
<CardContent>
<ul className="space-y-2 text-sm text-muted-foreground font-light">
<li> </li>
<li> </li>
<li> </li>
<li> </li>
<li> </li>
</ul>
</CardContent>
</Card>
<Card className="border-none shadow-sm bg-card/50 backdrop-blur">
<CardHeader>
<div className="flex items-center gap-3">
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-primary/10 text-primary">
<Network className="h-5 w-5" />
</div>
<CardTitle className="text-lg font-serif font-light"></CardTitle>
</div>
</CardHeader>
<CardContent>
<ul className="space-y-2 text-sm text-muted-foreground font-light">
<li> </li>
<li> </li>
<li> </li>
<li> </li>
<li> </li>
</ul>
</CardContent>
</Card>
<Card className="border-none shadow-sm bg-card/50 backdrop-blur">
<CardHeader>
<div className="flex items-center gap-3">
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-primary/10 text-primary">
<FileText className="h-5 w-5" />
</div>
<CardTitle className="text-lg font-serif font-light"></CardTitle>
</div>
</CardHeader>
<CardContent>
<ul className="space-y-2 text-sm text-muted-foreground font-light">
<li> </li>
<li> </li>
<li> </li>
<li> </li>
</ul>
</CardContent>
</Card>
<Card className="border-none shadow-sm bg-card/50 backdrop-blur">
<CardHeader>
<div className="flex items-center gap-3">
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-primary/10 text-primary">
<Settings className="h-5 w-5" />
</div>
<CardTitle className="text-lg font-serif font-light"></CardTitle>
</div>
</CardHeader>
<CardContent>
<ul className="space-y-2 text-sm text-muted-foreground font-light">
<li> </li>
<li> </li>
<li> </li>
<li> </li>
<li> </li>
</ul>
</CardContent>
</Card>
</div>
</TabsContent>
</Tabs>
</div>
</div>
</main>
</div>
)
}