feat: add R2 image handling and utility functions for image URLs

This commit is contained in:
Thuan Bui
2026-03-15 11:29:38 +07:00
parent 0be314edbe
commit 510c7f25d4
8 changed files with 46 additions and 55 deletions
+7
View File
@@ -0,0 +1,7 @@
import { R2_BASE } from "@/config/r2.mjs";
export function toR2Url(path?: string): string | undefined {
if (!path) return undefined;
if (path.startsWith("http")) return path;
return `${R2_BASE}${path}`;
}