@jfvilas/plugin-kubelog
Version:
Frontend plugin for viewing Kubernetes logs in Backstage
17 lines (14 loc) • 956 B
JavaScript
import React from 'react';
import Chip from '@material-ui/core/Chip';
const NamespaceChips = (props) => {
var cluster = props.resources.find((cluster2) => cluster2.name === props.selectedClusterName);
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.namespaceList.map((ns, index) => {
var existsAccessKey = cluster?.data.some((p) => p.namespace === ns && (p.accessKey || p.viewAccessKey || p.restartAccessKey));
if (existsAccessKey)
return /* @__PURE__ */ React.createElement(Chip, { component: "span", key: index, label: ns, onClick: () => props.onSelect(ns), variant: ns === props.selectedNamespace ? "default" : "outlined", size: "small", color: "primary" });
else
return /* @__PURE__ */ React.createElement(Chip, { component: "span", key: index, label: ns, size: "small", color: "secondary", variant: "outlined" });
}));
};
export { NamespaceChips };
//# sourceMappingURL=NamespaceChips.esm.js.map