import { prisma } from '@/lib/db'; import { getSession } from '@/lib/auth'; import { redirect } from 'next/navigation'; import { UserPlus, KeyRound, ShieldCheck } from 'lucide-react'; import { createUser, changePassword } from './actions'; import { DeleteUserButton } from './DeleteUserButton'; export default async function UsersAdminPage() { const session = await getSession(); if (!session) redirect('/admin/login'); const users = await prisma.user.findMany({ orderBy: { createdAt: 'asc' }, }); return (

Kullanıcı Yönetimi

{/* Sol: Kullanıcı listesi */}
{/* Yeni kullanıcı ekle */}

Yeni Kullanıcı Ekle

{/* Mevcut kullanıcılar */}

Mevcut Kullanıcılar ({users.length})

{users.map((user: any) => (

{user.username}

{new Date(user.createdAt).toLocaleDateString('tr-TR', { day: 'numeric', month: 'long', year: 'numeric', })}

))} {users.length === 0 && (

Kullanıcı bulunamadı.

)}
{/* Sağ: Şifre değiştir */}

Şifre Değiştir

); }