1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 05:19:39 +02:00
portainer/app/react/kubernetes/cluster/NodeView/NodeApplicationsDatatable/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

39 lines
1.2 KiB
TypeScript

import { CellContext } from '@tanstack/react-table';
import { isExternalApplication } from '@/react/kubernetes/applications/utils';
import { useIsSystemNamespace } from '@/react/kubernetes/namespaces/queries/useIsSystemNamespace';
import { Application } from '@/react/kubernetes/applications/ListView/ApplicationsDatatable/types';
import { Link } from '@@/Link';
import { SystemBadge } from '@@/Badge/SystemBadge';
import { ExternalBadge } from '@@/Badge/ExternalBadge';
import { helper } from './columns.helper';
export const name = helper.accessor('Name', {
header: 'Name',
cell: Cell,
});
function Cell({ row: { original: item } }: CellContext<Application, string>) {
const isSystem = useIsSystemNamespace(item.ResourcePool);
return (
<div className="flex items-center gap-2">
<Link
to="kubernetes.applications.application"
params={{ name: item.Name, namespace: item.ResourcePool }}
data-cy={`application-link-${item.Name}`}
>
{item.Name}
</Link>
{isSystem ? (
<SystemBadge className="ml-auto" />
) : (
isExternalApplication({ metadata: item.Metadata }) && (
<ExternalBadge className="ml-auto" />
)
)}
</div>
);
}