import type { CSSProperties, ReactNode } from "react";
import { Router } from "@tarojs/runtime/dist/current";
import Taro from "@tarojs/taro";

export interface BasicComponent {
  className?: string;
  style?: CSSProperties;
  children?: ReactNode;
  id?: string;
}

export interface CommonComponent {
  user: AuthAPI.UserVO;
  shareOptions: any;
  userRoleVO: BusinessAPI.UserRoleVO;
  router: Router;
  options: Taro.getLaunchOptionsSync.LaunchOptions;
  isInitialized: boolean;
  setIsInitialized: (isInitialized: boolean) => void;
  longitude?: number;
  latitude?: number;
  setLoading: (loading: boolean) => void;
}

export const ComponentDefaults = {
  className: "",
  style: {},
};

export interface BoxBrand {
  id: string;
  boxBrandId: string;
  boxBrandName: string;
  boxBrandImage: string;
  boxBrandType: "OUR_BOX" | "FARMER_BOX" | "THIRD_PARTY_BOX" | "GIFT_BOX";
  boxType: "USED" | "EXTRA" | "EXTRA_USED" | "REMAIN" | "OWN" | "EMPTY";
  boxSpecList: BoxSpec[];
}

export interface BoxProduct {
  id: string;
  boxBrandId: string;
  boxBrandName: string;
  boxProductId: string;
  boxProductName: string;
  boxCount: number;
  boxProductWeight: number;
  boxSpecId: string;
  boxSpecName: string;
  boxCostPrice: number;
  boxSalePrice: number;
}

export interface BoxSpec {
  id: string;
  boxSpecId: string;
  boxSpecName: string;
  boxProductList: BoxProduct[];
}
