Stage 1: Course/Module/Lesson CRUD admin UI with TipTap editor

This commit is contained in:
2026-04-07 11:36:27 +05:00
parent 9d82b73e58
commit d356dddc96
30 changed files with 2090 additions and 41 deletions
+21 -40
View File
@@ -1,46 +1,27 @@
import { headers } from "next/headers";
import { auth } from "@/lib/auth";
import { redirect } from "next/navigation";
import { LogoutButton } from "@/components/layout/logout-button";
export default async function AdminDashboard() {
const session = await auth.api.getSession({ headers: await headers() });
if (!session) redirect("/login");
if (session.user.role !== "admin") redirect("/dashboard");
import Link from "next/link";
export default function AdminDashboard() {
return (
<div className="min-h-screen bg-slate-50">
<header className="bg-white border-b border-slate-200 px-6 py-4 flex items-center justify-between">
<h1 className="text-xl font-bold text-slate-900">Second Brain Админ</h1>
<div className="flex items-center gap-4">
<span className="text-sm text-gray-600">{session.user.name}</span>
<LogoutButton />
<div className="p-8">
<h1 className="text-2xl font-semibold text-slate-800 mb-1">Обзор</h1>
<p className="text-slate-500 mb-8">Управление платформой Second Brain.</p>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<Link href="/admin/courses" className="bg-white rounded-2xl border border-slate-200 p-6 hover:border-amber-300 transition-colors">
<p className="text-3xl mb-2">📚</p>
<p className="font-medium text-slate-800">Курсы</p>
<p className="text-sm text-slate-400 mt-1">Управление контентом</p>
</Link>
<Link href="/admin/users" className="bg-white rounded-2xl border border-slate-200 p-6 hover:border-amber-300 transition-colors">
<p className="text-3xl mb-2">👥</p>
<p className="font-medium text-slate-800">Пользователи</p>
<p className="text-sm text-slate-400 mt-1">Управление доступом</p>
</Link>
<div className="bg-white rounded-2xl border border-slate-200 p-6 opacity-50">
<p className="text-3xl mb-2">📊</p>
<p className="font-medium text-slate-800">Аналитика</p>
<p className="text-sm text-slate-400 mt-1">Этап 10</p>
</div>
</header>
<main className="max-w-5xl mx-auto px-6 py-10">
<h2 className="text-2xl font-semibold text-gray-800 mb-2">
Панель администратора
</h2>
<p className="text-gray-500 mb-8">Управление платформой Second Brain.</p>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<div className="bg-white rounded-2xl border border-slate-200 p-6">
<p className="text-3xl mb-2">📚</p>
<p className="font-medium text-gray-800">Курсы</p>
<p className="text-sm text-gray-400 mt-1">CRUD Этап 1</p>
</div>
<div className="bg-white rounded-2xl border border-slate-200 p-6">
<p className="text-3xl mb-2">👥</p>
<p className="font-medium text-gray-800">Пользователи</p>
<p className="text-sm text-gray-400 mt-1">Управление Этап 1</p>
</div>
<div className="bg-white rounded-2xl border border-slate-200 p-6">
<p className="text-3xl mb-2">📊</p>
<p className="font-medium text-gray-800">Аналитика</p>
<p className="text-sm text-gray-400 mt-1">Этап 10</p>
</div>
</div>
</main>
</div>
</div>
);
}