import { useLocalizedName } from "@/shared/common/localizedName"; import { ItemDTO, OrganizationUserDto, User } from "@/shared/dto/user/usersDto"; import { ColumnDef } from "@tanstack/react-table"; import ArchivedUserActionsCell from "./ArchivedUsers/ArchivedUserActions"; import { format } from "date-fns/format"; import { t } from "i18next"; import { Badge } from "@/shared/common/ui/badge"; export const ArchivedUserColumnDefn: ColumnDef[] = [ { accessorKey: "name", header: () => t("setting.Name"), cell: ({ row }) => { // eslint-disable-next-line react-hooks/rules-of-hooks const localizedName = useLocalizedName(); const name = row.original?.name; return {localizedName(name)}; }, }, // { // accessorKey: "username", // header: "Username", // cell: ({ row }) => { // const username = row.original.username; // return {username}; // }, // }, // { // accessorKey: "createdAt", // header: "Created At", // cell: ({ row }) => { // const date = row.original.createdAt; // return {format(new Date(date), "MMM d, yyyy HH:mm")}; // }, // }, { accessorKey: "status", header: () => t("userRecord.Status"), cell: ({ row }) => { const status = row.original?.status; const getStatusColor = (status: string) => { switch (status.toLowerCase()) { case "inactive": return "bg-red-100 text-red-600 hover:bg-red-100"; // red for inactive case "active": return "bg-primary-100 text-primary-600 hover:bg-primary-100"; // green for active default: return "bg-gray-100 text-gray-600 hover:bg-gray-100"; } }; const getStatusText = (status: string) => { switch (status.toLowerCase()) { case "inactive": return "InActive"; case "active": return "Active"; default: return "Not Available"; } }; return (
{getStatusText(status)}
); }, }, { id: "actions", header: () => t("userRecord.Actions"), cell: ({ row }) => , }, ];