mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-12 18:26:36 +08:00
prettier
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client"
|
||||
'use client';
|
||||
|
||||
import {AccessTokenMain} from "@/components/common/settings/access-token"
|
||||
import { AccessTokenMain } from '@/components/common/settings/access-token';
|
||||
|
||||
export default function AccessTokenPage() {
|
||||
return <AccessTokenMain />
|
||||
return <AccessTokenMain />;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {AppearanceMain} from "@/components/common/settings/appearance"
|
||||
import { AppearanceMain } from '@/components/common/settings/appearance';
|
||||
|
||||
export default function AppearancePage() {
|
||||
return <AppearanceMain />
|
||||
return <AppearanceMain />;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"use client"
|
||||
'use client';
|
||||
|
||||
import {RequireAuth} from "@/components/auth/require-auth"
|
||||
import { RequireAuth } from '@/components/auth/require-auth';
|
||||
|
||||
export default function SettingsLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return <RequireAuth>{children}</RequireAuth>
|
||||
}
|
||||
return <RequireAuth>{children}</RequireAuth>;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {NotificationsMain} from "@/components/common/settings/notifications"
|
||||
import { NotificationsMain } from '@/components/common/settings/notifications';
|
||||
|
||||
export default function NotificationsPage() {
|
||||
return <NotificationsMain />
|
||||
return <NotificationsMain />;
|
||||
}
|
||||
|
||||
@@ -1,67 +1,79 @@
|
||||
"use client"
|
||||
'use client';
|
||||
|
||||
import Link from "next/link"
|
||||
import {Card, CardContent, CardDescription, CardTitle} from "@/components/ui/card"
|
||||
import {Bell, Key, Palette, UserRound} from "lucide-react"
|
||||
import Link from 'next/link';
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardTitle,
|
||||
} from '@/components/ui/card';
|
||||
import { Bell, Key, Palette, UserRound } from 'lucide-react';
|
||||
|
||||
/* 设置项 */
|
||||
const settingsItems = [
|
||||
{
|
||||
title: "个人资料",
|
||||
description: "查看您的账户信息",
|
||||
title: '个人资料',
|
||||
description: '查看您的账户信息',
|
||||
icon: UserRound,
|
||||
href: "/settings/profile",
|
||||
category: "个人设置",
|
||||
href: '/settings/profile',
|
||||
category: '个人设置',
|
||||
},
|
||||
{
|
||||
title: "访问令牌 (AccessToken)",
|
||||
description: "管理用于 API 访问的个人 Token",
|
||||
title: '访问令牌 (AccessToken)',
|
||||
description: '管理用于 API 访问的个人 Token',
|
||||
icon: Key,
|
||||
href: "/settings/access-token",
|
||||
category: "个人设置",
|
||||
href: '/settings/access-token',
|
||||
category: '个人设置',
|
||||
},
|
||||
{
|
||||
title: "通知设置",
|
||||
description: "设置您的通知偏好",
|
||||
title: '通知设置',
|
||||
description: '设置您的通知偏好',
|
||||
icon: Bell,
|
||||
href: "/settings/notifications",
|
||||
category: "账户设置",
|
||||
href: '/settings/notifications',
|
||||
category: '账户设置',
|
||||
},
|
||||
{
|
||||
title: "外观设置",
|
||||
description: "自定义界面主题 and 显示",
|
||||
title: '外观设置',
|
||||
description: '自定义界面主题 and 显示',
|
||||
icon: Palette,
|
||||
href: "/settings/appearance",
|
||||
category: "个人设置",
|
||||
href: '/settings/appearance',
|
||||
category: '个人设置',
|
||||
},
|
||||
]
|
||||
];
|
||||
|
||||
export default function SettingsPage() {
|
||||
const groupedSettings = settingsItems.reduce((acc, item) => {
|
||||
if (!acc[item.category]) {
|
||||
acc[item.category] = []
|
||||
}
|
||||
acc[item.category].push(item)
|
||||
return acc
|
||||
}, {} as Record<string, typeof settingsItems>)
|
||||
const groupedSettings = settingsItems.reduce(
|
||||
(acc, item) => {
|
||||
if (!acc[item.category]) {
|
||||
acc[item.category] = [];
|
||||
}
|
||||
acc[item.category].push(item);
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, typeof settingsItems>,
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="space-y-6 py-6">
|
||||
<div className="font-semibold text-lg">设置</div>
|
||||
<div className='space-y-6 py-6'>
|
||||
<div className='font-semibold text-lg'>设置</div>
|
||||
|
||||
{Object.entries(groupedSettings).map(([category, items]) => (
|
||||
<div key={category} className="space-y-4">
|
||||
<div className="font-medium text-sm text-muted-foreground">{category}</div>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div key={category} className='space-y-4'>
|
||||
<div className='font-medium text-sm text-muted-foreground'>
|
||||
{category}
|
||||
</div>
|
||||
<div className='grid grid-cols-2 gap-4'>
|
||||
{items.map((item) => (
|
||||
<Link key={item.href} href={item.href}>
|
||||
<Card className="py-2 border border-dashed shadow-none hover:bg-muted/50 transition-colors cursor-pointer h-full">
|
||||
<Card className='py-2 border border-dashed shadow-none hover:bg-muted/50 transition-colors cursor-pointer h-full'>
|
||||
<CardContent>
|
||||
<div className="flex items-center gap-4">
|
||||
<item.icon className="size-5 text-primary" />
|
||||
<div className='flex items-center gap-4'>
|
||||
<item.icon className='size-5 text-primary' />
|
||||
<div>
|
||||
<CardTitle className="mb-1 text-sm">{item.title}</CardTitle>
|
||||
<CardDescription className="text-xs">
|
||||
<CardTitle className='mb-1 text-sm'>
|
||||
{item.title}
|
||||
</CardTitle>
|
||||
<CardDescription className='text-xs'>
|
||||
{item.description}
|
||||
</CardDescription>
|
||||
</div>
|
||||
@@ -74,5 +86,5 @@ export default function SettingsPage() {
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {ProfileMain} from "@/components/common/settings/profile"
|
||||
import { ProfileMain } from '@/components/common/settings/profile';
|
||||
|
||||
export default function ProfilePage() {
|
||||
return <ProfileMain />
|
||||
return <ProfileMain />;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {redirect} from "next/navigation"
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
export default function SecurityPage() {
|
||||
redirect("/admin/settings")
|
||||
redirect('/admin/settings');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user