import {IS_NATIVE} from '#/env'

export const IMAGE_FORMATS = [
  {label: 'AVIF', value: 'avif'},
  {label: 'WebP', value: 'webp'},
  {label: 'JPEG', value: 'jpeg'},
  {label: 'PNG', value: 'png'},
  {label: 'GIF', value: 'gif'},
  {label: 'BMP', value: 'bmp'},
  {label: 'ICO', value: 'ico'},
  {label: 'JPEG XL', value: 'jxl'},
  ...(IS_NATIVE ? [{label: 'HEIC', value: 'heic'}] : []),
]

export function formatToFileExt(format: string) {
  if (format === 'jpeg') return 'jpg'
  return format
}
