2023-04-27 02:22:05 +00:00
|
|
|
import moment from 'moment';
|
2023-05-02 06:42:16 +00:00
|
|
|
import { createColumnHelper } from '@tanstack/react-table';
|
2022-11-22 12:16:34 +00:00
|
|
|
|
2023-03-06 20:25:04 +00:00
|
|
|
import { WaitingRoomEnvironment } from '../types';
|
2022-11-22 12:16:34 +00:00
|
|
|
|
2023-05-02 06:42:16 +00:00
|
|
|
const columnHelper = createColumnHelper<WaitingRoomEnvironment>();
|
|
|
|
|
|
|
|
export const columns = [
|
|
|
|
columnHelper.accessor('Name', {
|
|
|
|
header: 'Name',
|
2022-11-22 12:16:34 +00:00
|
|
|
id: 'name',
|
2023-05-02 06:42:16 +00:00
|
|
|
}),
|
|
|
|
columnHelper.accessor('EdgeID', {
|
|
|
|
header: 'Edge ID',
|
2022-11-22 12:16:34 +00:00
|
|
|
id: 'edge-id',
|
2023-05-02 06:42:16 +00:00
|
|
|
}),
|
|
|
|
columnHelper.accessor((row) => row.EdgeGroups.join(', ') || '-', {
|
|
|
|
header: 'Edge Groups',
|
2023-03-06 20:25:04 +00:00
|
|
|
id: 'edge-groups',
|
2023-05-02 06:42:16 +00:00
|
|
|
}),
|
|
|
|
columnHelper.accessor((row) => row.Group || '-', {
|
|
|
|
header: 'Group',
|
2023-03-06 20:25:04 +00:00
|
|
|
id: 'group',
|
2023-05-02 06:42:16 +00:00
|
|
|
}),
|
|
|
|
columnHelper.accessor((row) => row.Tags.join(', ') || '-', {
|
|
|
|
header: 'Tags',
|
2023-03-06 20:25:04 +00:00
|
|
|
id: 'tags',
|
2023-05-02 06:42:16 +00:00
|
|
|
}),
|
|
|
|
columnHelper.accessor((row) => row.LastCheckInDate, {
|
|
|
|
header: 'Last Check-in',
|
2023-04-27 02:22:05 +00:00
|
|
|
id: 'last-check-in',
|
2023-05-02 06:42:16 +00:00
|
|
|
cell: ({ getValue }) => {
|
|
|
|
const value = getValue();
|
|
|
|
return value ? moment(value * 1000).fromNow() : '-';
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
];
|