1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/renderer/components/+workloads-pods/pod-details-statuses.tsx
Sebastian Malton 2e2283bcc9
enfore unix line endings and always ending files with line endings (#1997)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2021-01-21 08:09:41 -05:00

31 lines
710 B
TypeScript

import "./pod-details-statuses.scss";
import React from "react";
import countBy from "lodash/countBy";
import kebabCase from "lodash/kebabCase";
import { Pod } from "../../api/endpoints";
interface Props {
pods: Pod[];
}
export class PodDetailsStatuses extends React.Component<Props> {
render() {
const { pods } = this.props;
if (!pods.length) return null;
const statuses = countBy(pods.map(pod => pod.getStatus()));
return (
<div className="PodDetailsStatuses">
{
Object.keys(statuses).map(key => (
<span key={key} className={kebabCase(key)}>
{key}: {statuses[key]}
</span>
))
}
</div>
);
}
}