1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 00:09:40 +02:00
portainer/app/react/kubernetes/ingresses/IngressDatatable/columns/name.tsx
Prabhat Khera f7840e0407
fix(ui): mark resources system correctly [EE-6558] (#10996)
* fix(ui): mark resources system correctly [EE-6558]

* address review comments
2024-01-23 13:49:25 +13:00

44 lines
1 KiB
TypeScript

import { CellContext } from '@tanstack/react-table';
import { Authorized } from '@/react/hooks/useUser';
import { Link } from '@@/Link';
import { Badge } from '@@/Badge';
import { Ingress } from '../../types';
import { columnHelper } from './helper';
export const name = columnHelper.accessor('Name', {
header: 'Name',
cell: Cell,
id: 'name',
});
function Cell({ row, getValue }: CellContext<Ingress, string>) {
const name = getValue();
const namespace = row.original.Namespace;
return (
<div className="flex flex-nowrap whitespace-nowrap">
<Authorized authorizations="K8sIngressesW" childrenUnauthorized={name}>
<Link
to="kubernetes.ingresses.edit"
params={{
uid: row.original.UID,
namespace,
name,
}}
title={name}
>
{name}
</Link>
</Authorized>
{row.original.IsSystem && (
<Badge type="success" className="ml-2">
System
</Badge>
)}
</div>
);
}