/** Image formats the media library accepts, with the extension each is stored under. */
export const ALLOWED_IMAGE_TYPES = {
  "image/jpeg": "jpg",
  "image/png": "png",
  "image/webp": "webp",
  "image/avif": "avif",
} as const;

export type AllowedImageType = keyof typeof ALLOWED_IMAGE_TYPES;

/** Value for `<input accept>`. The server re-checks the bytes regardless. */
export const IMAGE_ACCEPT =
  ".jpg,.jpeg,.png,.webp,.avif,image/jpeg,image/png,image/webp,image/avif";

export const IMAGE_TYPE_LABEL: Record<string, string> = {
  "image/jpeg": "JPEG",
  "image/png": "PNG",
  "image/webp": "WebP",
  "image/avif": "AVIF",
};

/** Shown under image uploaders. Matches the 1.91:1 ratio link previews use. */
export const FEATURED_IMAGE_SIZE = { width: 1200, height: 630 };
