feat: image resizer

This commit is contained in:
Ivan Rezchikov
2026-07-15 22:19:26 +03:00
parent e56157f562
commit 687fbaf3a6
7 changed files with 80 additions and 23 deletions
+5 -3
View File
@@ -1,7 +1,7 @@
import { getPages } from "@/lib/pages/repository";
import { getCurrentUser } from "@/lib/user";
import { formatDate } from "@/lib/utils";
import { ArchiveIcon, CalendarIcon } from "lucide-react";
import { ArchiveIcon, CalendarIcon, PencilLineIcon } from "lucide-react";
import { Metadata } from "next";
import Link from "next/link";
import { redirect } from "next/navigation";
@@ -14,8 +14,9 @@ export default async function List() {
const pagesPublished = await getPages("PAGE", "PUBLISHED");
const pagesArchived = await getPages("PAGE", "ARCHIVED");
const pagesDraft = await getPages("PAGE", "DRAFT");
const pages = [...pagesPublished, ...pagesArchived].sort((a, b) => {
const pages = [...pagesPublished, ...pagesArchived, ...pagesDraft].sort((a, b) => {
const aDate = new Date(a.updatedAt ?? a.publishedAt).getTime();
const bDate = new Date(b.updatedAt ?? b.publishedAt).getTime();
@@ -33,8 +34,9 @@ export default async function List() {
<h3 className="truncate">{p.title}</h3>
</Link>
<div className="flex flex-row gap-4">
<h5 className="flex gap-1 items-center"><CalendarIcon size={14} />{formatDate(p.publishedAt)}</h5>
{p.publishedAt && <h5 className="flex gap-1 items-center"><CalendarIcon size={14} />{formatDate(p.publishedAt)}</h5>}
{p.status === "ARCHIVED" && <h5 className="flex gap-1 items-center"><ArchiveIcon size={14} />Archived</h5>}
{p.status === "DRAFT" && <h5 className="flex gap-1 items-center"><PencilLineIcon size={14} />Draft</h5>}
</div>
</div>
)) : <h2 className="text-muted-foreground">There are no pages yet...</h2>