import type { ImageAsset } from "@/types/content";

export function getImageUrl(image?: ImageAsset) {
  if (!image) return undefined;
  return typeof image === "string" ? image : image.url || undefined;
}

export function getImageAlt(image: ImageAsset | undefined, fallback: string) {
  if (!image || typeof image === "string") return fallback;
  return image.alt || fallback;
}
