mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix all Age, LastSeen, and FirstSeen displays (#4990)
This commit is contained in:
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} />
|
||||
);
|
||||
Reference in new issue
Block a user