1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 07:19:41 +02:00

feat(app): migrate app containers to react [EE-5353] (#9992)

This commit is contained in:
Ali 2023-08-17 22:00:25 +12:00 committed by GitHub
parent 6290e9facc
commit 23295d2736
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 312 additions and 297 deletions

View file

@ -0,0 +1,29 @@
import { CellContext } from '@tanstack/react-table';
import { Badge, BadgeType } from '@@/Badge';
import { ContainerRowData } from '../types';
import { columnHelper } from './helper';
export const status = columnHelper.accessor('status', {
header: 'Status',
cell: StatusCell,
});
function StatusCell({ getValue }: CellContext<ContainerRowData, string>) {
return <Badge type={getContainerStatusType(getValue())}>{getValue()}</Badge>;
}
function getContainerStatusType(status: string): BadgeType {
switch (status.toLowerCase()) {
case 'running':
return 'success';
case 'waiting':
return 'warn';
case 'terminated':
return 'info';
default:
return 'danger';
}
}