// src/components/manajemenUsers/UserTable.tsx import type { UserType } from "../../routes/ManajementUsers"; type Props = { users: UserType[]; selectedRole: string; search: string; onEdit: ( user: UserType ) => void; onDelete: ( id: string ) => void; }; export default function UsersTable({ users, selectedRole, search, onEdit, onDelete, }: Props) { /* FILTER */ const filteredUsers = users.filter((user) => { const matchRole = selectedRole === "Semua" || user.role === selectedRole; const matchSearch = user.nama .toLowerCase() .includes( search.toLowerCase() ); return ( matchRole && matchSearch ); }); return (
{/* HEADER */} {/* BODY */} {filteredUsers.map( (user) => ( {/* AKSI */} ) )}
ID Nama Role Kelas Status Aksi
{user.id} {user.nama} {user.role} {user.kelas} {user.status}
{/* EDIT */} {/* HAPUS */}
); }