mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
chore(deps): upgrade react-table to v8 [EE-4837] (#8245)
This commit is contained in:
parent
f20d3e72b9
commit
757461d58b
140 changed files with 1805 additions and 2872 deletions
|
@ -1,4 +1,4 @@
|
|||
import { CellProps, Column } from 'react-table';
|
||||
import { CellContext } from '@tanstack/react-table';
|
||||
import { Check, X } from 'lucide-react';
|
||||
|
||||
import { Badge } from '@@/Badge';
|
||||
|
@ -6,23 +6,23 @@ import { Icon } from '@@/Icon';
|
|||
|
||||
import type { IngressControllerClassMap } from '../../types';
|
||||
|
||||
export const availability: Column<IngressControllerClassMap> = {
|
||||
Header: 'Availability',
|
||||
accessor: 'Availability',
|
||||
Cell: AvailailityCell,
|
||||
id: 'availability',
|
||||
disableFilters: true,
|
||||
canHide: true,
|
||||
sortInverted: true,
|
||||
sortType: 'basic',
|
||||
Filter: () => null,
|
||||
};
|
||||
import { columnHelper } from './helper';
|
||||
|
||||
export const availability = columnHelper.accessor('Availability', {
|
||||
header: 'Availability',
|
||||
cell: Cell,
|
||||
id: 'availability',
|
||||
invertSorting: true,
|
||||
sortingFn: 'basic',
|
||||
});
|
||||
|
||||
function Cell({ getValue }: CellContext<IngressControllerClassMap, boolean>) {
|
||||
const availability = getValue();
|
||||
|
||||
function AvailailityCell({ value }: CellProps<IngressControllerClassMap>) {
|
||||
return (
|
||||
<Badge type={value ? 'success' : 'danger'}>
|
||||
<Icon icon={value ? Check : X} className="!mr-1" />
|
||||
{value ? 'Allowed' : 'Disallowed'}
|
||||
<Badge type={availability ? 'success' : 'danger'}>
|
||||
<Icon icon={availability ? Check : X} className="!mr-1" />
|
||||
{availability ? 'Allowed' : 'Disallowed'}
|
||||
</Badge>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue