feat: enhance layout of search

This commit is contained in:
2023-08-06 17:47:26 +02:00
parent 0e0d26c939
commit 6f650b568d
25 changed files with 518 additions and 172 deletions

View File

@@ -1,3 +1,5 @@
import { resources } from "@lib/resources.ts";
export function formatDate(date: Date): string {
const options = { year: "numeric", month: "long", day: "numeric" } as const;
return new Intl.DateTimeFormat("en-US", options).format(date);
@@ -92,3 +94,9 @@ export function getCookie(name: string): string | null {
return decodeURIComponent(cookie.substring(nameLenPlus));
})[0] || null;
}
const resourcePrefixes = Object.values(resources).map((v) => v.prefix).filter(
(s) => s.length > 2,
);
export const isLocalImage = (src: string) =>
resourcePrefixes.some((p) => src.startsWith(p));