import {
  ArticleModel,
  ArticlesModel,
} from "./models";

export interface LatestProps {
  articles: ArticlesModel;
  onSelectArticle?: (index: number) => void;
  onLoadMore?: (offset: number, limit: number) => Promise<void>; // optional async callback
}

export interface MainContentProps {
  articles: ArticlesModel;
  onSelectArticle: (index: ArticleModel) => void;
}

export interface ProfileProps {
  onBack: () => void;
}

export interface ArticleViewProps {
  article: ArticleModel;
  onBack: () => void;
  onEdit: () => void;
}

export interface ArticleEditorProps {
  article?: ArticleModel | null;
  onBack: () => void;
}

export interface ArticleMetaProps {
  article: ArticleModel;
}

export interface ArticleCardProps {
  article: ArticleModel;
  index: number;
  focusedCardIndex: number | null;
  onSelectArticle: (index: ArticleModel) => void;
  onFocus: (index: number) => void;
  onBlur: () => void;
}

export interface ArticleGridProps {
  articles: ArticlesModel;
  onSelectArticle: (index: ArticleModel) => void;
  xs?: number;  // default 12 for mobile full-width
  md12?: number, // default 12 (full-width)
  md6?: number; // default 6 (half-width)
  md4?: number; // default 4 (third-width)
  nested?: 1 | 2; // number of stacked cards in a nested column
}

export interface ImageUploadFieldProps {
  label?: string;
  value?: string;
  uploading?: boolean;
  onUpload: (file: File) => void;
  size?: number;
}
