diff --git a/src/app/document/page.tsx b/src/app/document/page.tsx
index b5583aa..b4a9362 100644
--- a/src/app/document/page.tsx
+++ b/src/app/document/page.tsx
@@ -19,19 +19,30 @@ const DocumentCardWrapper = ({
return
}
+const getDocumentDate = (id: string) => {
+ const dates = documents[id].manifest.dates
+ return dates[dates.length - 1]
+}
+
const Page = () => {
+ const sortedDocuments = Object.entries(documents).sort((a, b) => {
+ const docTimestampA = getDocumentDate(a[0])
+ const docTimestampB = getDocumentDate(b[0])
+ return docTimestampB - docTimestampA
+ })
+
return (
Documents
- {Object.keys(documents).map((documentShortName) => {
+ {sortedDocuments.map((entry) => {
return (
-
+
)