import type {
  BoardItem,
  UploadFileData,
  BoardAccessMode,
  OrderByDirection,
} from '~/types';

export interface ThumbnailData {
  input: Ref<File | null>;
  preview: Ref<string>;
  deleteTrigger: Ref<boolean>;
  oldPreviewState: Ref<boolean>;
  uploadState: Ref<boolean>;
  previewState: Ref<boolean>;
  displayedName: Ref<string>;
}

export type UpdateDisplayedItemsFn = (
  currentItems: Ref<BoardItem[]>,
  displayedItems: Ref<BoardItem[]>,
  currentPage: Ref<number>,
  itemsPerPage: number
) => void;

export interface UploadsData {
  thumbnail: ThumbnailData;
  files: UploadFileData[];
}
//For BoardNav
export interface BoardNavConfig {
  currentPage: Ref<number>;
  currentCollection: string;
  sortingOrder: Ref<OrderByDirection>;
  userRole: Ref<number>;
  currentItems: Ref<BoardItem[]>;
  itemsPerPage: number;
  access?: BoardAccessMode;
  totalCount?: Ref<number>;
}
