'use client' import { useActionState, useState } from 'react' import { changePassword, deleteUser } from './actions' import { KeyRound, Trash2, ChevronDown, ChevronUp, Shield } from 'lucide-react' type User = { id: number username: string role: string created_at: Date } function ChangePasswordForm({ userId }: { userId: number }) { const action = changePassword.bind(null, userId) const [state, formAction, isPending] = useActionState(action, undefined) return (
) } function UserRow({ user }: { user: User }) { const [expanded, setExpanded] = useState(false) async function handleDelete() { if (!confirm(`"${user.username}" kullanıcısını silmek istediğinize emin misiniz?`)) return const res = await deleteUser(user.id) if (res?.error) alert(res.error) } return ({user.username}
{new Date(user.created_at).toLocaleDateString('tr-TR', { day: 'numeric', month: 'long', year: 'numeric' })}
Henüz kullanıcı yok.
) : (