export type ProductImage = {
  productIndex: number;
  imageUrl: string;
  loading: boolean;
  fileName: string;
  notices?: ImageNotice[];
  metadata?: ImageMetadata;
  // Schema fields
  pid: number;
  iid: number;
  type: number;
  order: number;
  width: number;
  height: number;
  hidden: number;
}

export type ImageNoticeLevel = 'info' | 'warning';

export type ImageNotice = {
  message: string;
  level: ImageNoticeLevel;
  code?: string;
  source?: 'client' | 'server';
};

export type ImageMetadata = {
  width?: number;
  height?: number;
  size?: number;
  optimizedSize?: number;
  colorSpace?: string;
  quality?: number;
  resized?: boolean;
  convertedToRgb?: boolean;
};

export type UnassignedImage = {
  file: File;
  previewUrl: string;
}

// Product ID type to handle the sortable state
export type ProductImageSortable = ProductImage & {
  id: string;
};

// Shared Product interface
export interface Product {
  id?: number;
  name?: string;
  upc?: string;
  supplier_no?: string;
  sku?: string;
  model?: string;
  company?: string;
  product_images?: string | string[];
} 
