/** * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ import "./pod-tolerations.scss"; import React from "react"; import uniqueId from "lodash/uniqueId"; import type { Toleration } from "../../../common/k8s-api/kube-object"; import { Table, TableCell, TableHead, TableRow } from "../table"; export interface PodTolerationsProps { tolerations: Toleration[]; } enum sortBy { Key = "key", Operator = "operator", Effect = "effect", Seconds = "seconds", Value = "value", } const getTableRow = (toleration: Toleration) => { const { key, operator, effect, tolerationSeconds, value } = toleration; return ( {key} {operator} {value} {effect} {tolerationSeconds} ); }; export function PodTolerations({ tolerations }: PodTolerationsProps) { return ( toleration.key, [sortBy.Operator]: toleration => toleration.operator, [sortBy.Effect]: toleration => toleration.effect, [sortBy.Seconds]: toleration => toleration.tolerationSeconds, }} sortSyncWithUrl={false} className="PodTolerations" renderRow={getTableRow} > Key Operator Value Effect Seconds
); }