1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00
portainer/app/react/kubernetes/ingresses/IngressDatatable/columns/name.tsx
James Player f6f07f4690 improvement(kubernetes): right align tags in datatables R8S-250 (#601)
Co-authored-by: testA113 <aliharriss1995@gmail.com>
2025-04-03 14:18:31 +13:00

41 lines
1 KiB
TypeScript

import { CellContext } from '@tanstack/react-table';
import { Authorized } from '@/react/hooks/useUser';
import { SystemBadge } from '@@/Badge/SystemBadge';
import { Link } from '@@/Link';
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 gap-2">
<Authorized authorizations="K8sIngressesW" childrenUnauthorized={name}>
<Link
to="kubernetes.ingresses.edit"
params={{
uid: row.original.UID,
namespace,
name,
}}
title={name}
data-cy={`ingress-name-link-${name}`}
>
{name}
</Link>
</Authorized>
{row.original.IsSystem && <SystemBadge className="ml-auto" />}
</div>
);
}