Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/editors/task-editor/changed.tsx
1691 views
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
/*
7
Task last changed: displays when this task was last changed
8
*/
9
10
import { React } from "../../app-framework";
11
import { TimeAgo } from "../../components";
12
13
interface Props {
14
last_edited?: number;
15
}
16
17
export const Changed: React.FC<Props> = React.memo(({ last_edited }) => {
18
if (last_edited) {
19
return <TimeAgo date={new Date(last_edited)} />;
20
} else {
21
return <span />;
22
}
23
});
24
25