mirror of
https://github.com/zadam/trilium.git
synced 2025-12-23 16:49:58 +01:00
feat(layout): created & modification date
This commit is contained in:
22
apps/client/src/widgets/NoteTitleDetails.tsx
Normal file
22
apps/client/src/widgets/NoteTitleDetails.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { formatDateTime } from "../utils/formatters";
|
||||
import { useNoteContext } from "./react/hooks";
|
||||
import { joinElements } from "./react/react_utils";
|
||||
import { useNoteMetadata } from "./ribbon/NoteInfoTab";
|
||||
|
||||
export default function NoteTitleDetails() {
|
||||
const { note } = useNoteContext();
|
||||
const { metadata } = useNoteMetadata(note);
|
||||
|
||||
return (
|
||||
<div className="title-details">
|
||||
{joinElements([
|
||||
metadata?.dateCreated && <li>
|
||||
Created on {formatDateTime(metadata.dateCreated, "medium", "none")}
|
||||
</li>,
|
||||
metadata?.dateModified && <li>
|
||||
Modified on {formatDateTime(metadata.dateModified, "medium", "none")}
|
||||
</li>
|
||||
], " • ")}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user