import { MarginTypeEnum, TradeTypeEnum } from "@shared/types";
import React from "react";

export interface AdjustingLeverModalRefFuncProps {
  onValueUpdate: (v: string | number) => void;
}
export interface AdjustingLeverModalConfirmProps {
  lever?: number;
  marginType?: MarginTypeEnum;
  notionalCap?: number | string | undefined;
}
export interface AdjustingLeverModalProps {
  /**
   * defaultLever
   * */
  defaultLever?: number;
  /**
   * onConfirm
   * */
  onConfirm?: (obj: AdjustingLeverModalConfirmProps) => void;
  /**
   * originalNodes sample:
   *     [1,3,5,10,25,50,100] =>
   *     what marks like
   *     {
   *       1: { label: '1X', value: 1 },
   *       17.5: { label: '3X', value: 3 },
   *       34: { label: '5X', value: 5 },
   *       50.5: { label: '10X', value: 10 },
   *       ...
   *     }
   * */
  defaultOriginalNodes?: Array<number>;

  /**
   * marginType: Cross.全仓 Isolated.逐仓
   * */
  initMarginType: MarginTypeEnum;
  // onMarginTypeChange: (m: MarginTypeEnum) => void;
  disabledCross?: boolean;
  disabledIsolated?: boolean;
  tradeType: TradeTypeEnum;
  symbol: string;

  onRef?: React.Ref<AdjustingLeverModalRefFuncProps | undefined>;
  askLimits?: any[];
}
