Merge branch 'development'

This commit is contained in:
sianida26 2024-02-20 07:12:00 +07:00
commit 16953fb53c
2 changed files with 7 additions and 1 deletions

View File

@ -33,7 +33,7 @@ export default function UsersTable(props: Props) {
}); });
const table = useReactTable({ const table = useReactTable({
data: props.userData, data: props.userData.map(data => ({...data, roles: data.roles.map(x => x.name)})),
columns: createColumns({ columns: createColumns({
permissions: props.permissions, permissions: props.permissions,
actions: { actions: {

View File

@ -11,6 +11,7 @@ export interface UserRow {
name: string | null; name: string | null;
email: string | null; email: string | null;
photoUrl: string | null; photoUrl: string | null;
roles: string[]
} }
interface ColumnOptions { interface ColumnOptions {
@ -64,6 +65,11 @@ const createColumns = (options: ColumnOptions) => {
), ),
}), }),
columnHelper.accessor("roles", {
header: "Role",
cell: (props) => <Text>{props.getValue()[0]}</Text>
}),
columnHelper.display({ columnHelper.display({
id: "status", id: "status",
header: "Status", header: "Status",