Initial commit: ANOUMA website with Payload CMS, WebRTC meetings, and booking system
- Next.js 16 App Router site with the ANOUMA design system - Payload CMS (PostgreSQL) for offers, events, posts and page content - WebRTC video-call system with custom signaling server - SMTP email reminders and booking-request notifications - Customer accounts, calendar-based availability, and booking workflow
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import type { Media } from "@/payload-types";
|
||||
|
||||
type MediaSize = "thumbnail" | "card" | "hero";
|
||||
|
||||
/** Resolves a populated (depth >= 1) media relationship to a usable image URL. */
|
||||
export function mediaUrl(
|
||||
value: Media | number | null | undefined,
|
||||
size?: MediaSize,
|
||||
): string | undefined {
|
||||
if (!value || typeof value === "number") return undefined;
|
||||
if (size) {
|
||||
const sized = value.sizes?.[size]?.url;
|
||||
if (sized) return sized;
|
||||
}
|
||||
return value.url ?? undefined;
|
||||
}
|
||||
|
||||
export function mediaAlt(value: Media | number | null | undefined): string | undefined {
|
||||
if (!value || typeof value === "number") return undefined;
|
||||
return value.alt;
|
||||
}
|
||||
Reference in New Issue
Block a user