export type SharedStoreType = {
  openSidebar: boolean;
  setOpenSidebar: (value: boolean) => void;

  isLogin: boolean;
  setIsLogin: (value: boolean) => void;
};

export interface ApiResponse<T> {
  status: number;
  success: boolean;
  results: T;
}

export type Category = {
  _id: string;
  title_fa: string;
  title_en: string;
  icon: string;
  imageUrl: string;
  description: string;
  variants: number[];
  hierarchy: string[];
  leaf: boolean;
  parent: string | null;
  deleted: boolean;
  createdAt: string;
  updatedAt: string;
  url: string;
  children: Category[];
  theme?: string;
};

export type CategoriesResponseType = ApiResponse<{
  data: Category[];
}>;

export type CategoryResponseType = ApiResponse<{
  id: string;
  name: string;
  parentId: string | null;
  createdAt: string;
  updatedAt: string;
}>;

export type UserMeResponseType = ApiResponse<{
  info: {
    _id: string;
    fullName: string;
    email: string;
    phoneNumber: string;
    dateOfBirth: string | null;
    address: string;
    nationalCode: string | null;
    homeNumber: string | null;
    createdAt: string;
    updatedAt: string;
    userAddress: {
      _id: string;
      address: string;
      city: {
        _id: number;
        name: string;
        province: number;
        createdAt: string;
        updatedAt: string;
        __v: number;
      };
      province: {
        _id: number;
        name: string;
        createdAt: string;
        updatedAt: string;
        __v: number;
      };
      postalCode: string;
      plaque: string;
      lat: string;
      lon: string;
      createdAt: string;
      updatedAt: string;
      __v: number;
    };
    isSeller: boolean;
  };
}>;
