export interface BlogCategory {
  _id: string;
  title_fa: string;
  slug: string;
  description: string;
  parent: string | null;
  leaf: boolean;
  createdAt: string;
  updatedAt: string;
  children: BlogCategory[];
}

export interface Blog {
  _id: string;
  title_fa: string;
  slug: string;
  category: {
    _id: string;
    title_fa: string;
    slug: string;
    description: string;
  };
  description: string;
  content: string;
  author: {
    fullName: string;
  };
  view: number;
  tags: string[];
  imageUrl: string;
  createdAt: string;
}

export interface Pager {
  page: number;
  limit: number;
  totalItems: number;
  totalPages: number;
  prevPage: boolean | null;
  nextPage: string | null;
}

export interface BlogsResponse {
  status: number;
  success: boolean;
  results: {
    pager: Pager;
    blogs: Blog[];
  };
}

export interface GetBlogsResult {
  pager: Pager;
  blogs: Blog[];
}

export type CreateBlogType = {
  title_fa: string;
  slug: string;
  category: string;
  description: string;
  content: string;
  tags: string[];
  imageUrl: string;
};

export type UpdateBlogType = {
  _id: string;
  title_fa: string;
  category: string;
  description: string;
  content: string;
  tags: string[];
  imageUrl: string;
};

export type BlogFormType = {
  title_fa: string;
  slug: string;
  category: string;
  description: string;
  content: string;
  tags: string[];
  imageUrl: string;
};

export interface BlogCategoriesResponse {
  status: number;
  success: boolean;
  results: {
    categories: BlogCategory[];
  };
}

export interface BlogDetailResponse {
  status: number;
  success: boolean;
  results: {
    blog: Blog;
  };
}
