mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-05 03:12:14 +00:00
65 lines
1.5 KiB
TypeScript
65 lines
1.5 KiB
TypeScript
"use client";
|
|
|
|
import { ColumnDef } from "@tanstack/react-table";
|
|
|
|
import { DateWithTime } from "@/components/providers";
|
|
import { StatusBadge } from "@/components/ui/table";
|
|
import { UserActions } from "@/components/users";
|
|
import { UserProps } from "@/types";
|
|
|
|
const getUserData = (row: { original: UserProps }) => {
|
|
return row.original;
|
|
};
|
|
|
|
export const ColumnsUser: ColumnDef<UserProps>[] = [
|
|
{
|
|
accessorKey: "email",
|
|
header: "Email",
|
|
cell: ({ row }) => {
|
|
const { email } = getUserData(row);
|
|
return <p className="font-semibold">{email}</p>;
|
|
},
|
|
},
|
|
{
|
|
accessorKey: "name",
|
|
header: "Name",
|
|
cell: ({ row }) => {
|
|
const { name } = getUserData(row);
|
|
return <p className="font-semibold">{name}</p>;
|
|
},
|
|
},
|
|
{
|
|
accessorKey: "role",
|
|
header: "Role",
|
|
cell: ({ row }) => {
|
|
const { role } = getUserData(row);
|
|
return <p className="font-semibold">{role}</p>;
|
|
},
|
|
},
|
|
{
|
|
accessorKey: "added",
|
|
header: "Added",
|
|
cell: ({ row }) => {
|
|
const { dateAdded } = getUserData(row);
|
|
return <DateWithTime dateTime={dateAdded} showTime={false} />;
|
|
},
|
|
},
|
|
{
|
|
accessorKey: "status",
|
|
header: "Status",
|
|
cell: ({ row }) => {
|
|
const { status } = getUserData(row);
|
|
return <StatusBadge status={status} />;
|
|
},
|
|
},
|
|
{
|
|
accessorKey: "actions",
|
|
header: () => <div className="text-right">Actions</div>,
|
|
id: "actions",
|
|
cell: ({ row }) => {
|
|
const userData = getUserData(row);
|
|
return <UserActions userData={userData} />;
|
|
},
|
|
},
|
|
];
|