Fix all Age, LastSeen, and FirstSeen displays (#4990)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2022-03-17 15:17:03 -04:00
1 parent c9cab22558
commit b08daa811d
48 files changed
+458 -344

No files matched your search

@@ -0,0 +1,22 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import React from "react";
import type { KubeObject } from "../../../common/k8s-api/kube-object";
import { ReactiveDuration } from "../duration/reactive-duration";
export interface KubeObjectAgeProps {
object: KubeObject;
/**
* Whether the display string should prefer length over precision
* @default true
*/
compact?: boolean;
}
export const KubeObjectAge = ({ object, compact = true }: KubeObjectAgeProps) => (
<ReactiveDuration timestamp={object.metadata.creationTimestamp} compact={compact} />
);