|
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 16 |
|
| 17 | +import { Icon } from '@iconify/react'; |
17 | 18 | import Box from '@mui/material/Box'; |
18 | 19 | import MenuItem from '@mui/material/MenuItem'; |
19 | 20 | import { useTheme } from '@mui/material/styles'; |
@@ -51,6 +52,7 @@ import { useLocalStorageState } from '../../globalSearch/useLocalStorageState'; |
51 | 52 | import { DateLabel } from '../Label'; |
52 | 53 | import Link from '../Link'; |
53 | 54 | import Table, { TableColumn } from '../Table'; |
| 55 | +import { LightTooltip } from '../Tooltip'; |
54 | 56 | import DeleteButton from './DeleteButton'; |
55 | 57 | import EditButton from './EditButton'; |
56 | 58 | import ResourceTableMultiActions from './ResourceTableMultiActions'; |
@@ -443,8 +445,31 @@ function ResourceTableContent<RowItem extends KubeObject>(props: ResourceTablePr |
443 | 445 | header: t('translation|Name'), |
444 | 446 | gridTemplate: 'auto', |
445 | 447 | accessorFn: (item: RowItem) => item.metadata.name, |
446 | | - Cell: ({ row }: { row: MRT_Row<RowItem> }) => |
447 | | - row.original && <Link kubeObject={row.original} />, |
| 448 | + Cell: ({ row }: { row: MRT_Row<RowItem> }) => { |
| 449 | + if (!row.original) { |
| 450 | + return null; |
| 451 | + } |
| 452 | + |
| 453 | + const isDeleting = !!row.original.metadata?.deletionTimestamp; |
| 454 | + |
| 455 | + return ( |
| 456 | + <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}> |
| 457 | + {isDeleting && ( |
| 458 | + <LightTooltip title={t('translation|Deleting')}> |
| 459 | + <Box component="span" sx={{ display: 'flex', color: 'text.secondary' }}> |
| 460 | + <Icon |
| 461 | + icon="mdi:trash-can-outline" |
| 462 | + width="1rem" |
| 463 | + height="1rem" |
| 464 | + color={theme.palette.error.main} |
| 465 | + /> |
| 466 | + </Box> |
| 467 | + </LightTooltip> |
| 468 | + )} |
| 469 | + <Link kubeObject={row.original} /> |
| 470 | + </Box> |
| 471 | + ); |
| 472 | + }, |
448 | 473 | }; |
449 | 474 | case 'age': |
450 | 475 | return { |
|
0 commit comments