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<{
  user: {
    id: string;
    createdAt: string;
    updatedAt: string;
    firstName: string;
    lastName: string;
    email: string;
    emailVerified: boolean;
    phone: string;
    birthDate: string;
    nationalCode: string;
    financialType: string;
    profilePic: string | null;
    userName: string | null;
    roles: Array<{
      id: string;
      createdAt: string;
      name: string;
    }>;
  };
}>;
