feat(admin): kullanıcı yönetimi tablosu ve diyalogları (mock)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-05 01:35:10 +03:00
parent 1cf9fd9d8c
commit 3b94bceaf0
9 changed files with 1282 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import type { Metadata } from "next";
import { PageHeader } from "@/components/page-header";
import { UsersTable } from "@/features/admin-users/components/users-table";
import { MOCK_ADMIN_USERS } from "@/features/admin-users/mock";
import { MOCK_SESSION_USER } from "@/features/auth/mock";
import { tr } from "@/i18n/tr";
export const metadata: Metadata = { title: tr.adminUsers.title };
export default function AdminUsersPage() {
// FAZ 3: const users = await listUsers() (Better Auth admin API)
return (
<>
<PageHeader title={tr.adminUsers.title} description={tr.adminUsers.description} />
<UsersTable initialUsers={MOCK_ADMIN_USERS} currentUserId={MOCK_SESSION_USER.id} />
</>
);
}
+11
View File
@@ -0,0 +1,11 @@
import { notFound } from "next/navigation";
import { MOCK_SESSION_USER } from "@/features/auth/mock";
/**
* Yalnızca sistem admini. Admin olmayana 404 (sayfanın varlığını bile göstermez).
* FAZ 3: `await requireRole("admin")` (lib/dal.ts) — sunucu tarafı gerçek kontrol.
*/
export default function AdminLayout({ children }: { children: React.ReactNode }) {
if (MOCK_SESSION_USER.role !== "admin") notFound();
return children;
}