import React from 'react';
import PriceRegion from './price-region';
import PriceLadder from './price-ladder';
import connect from "../connect";

export interface Props {
  type:
    | 'region' // 区间价
    | 'ladder'; // 阶梯价
}

const TplPrice: React.FC<Props> = ({ type, ...otherProps }) => {
  if (type === 'region') return <PriceRegion {...otherProps} />;
  if (type === 'ladder') return <PriceLadder {...otherProps} />;
  return null;
};

export default connect(TplPrice, {}, {
  'region': (PriceRegion as any).default,
  'ladder': (PriceLadder as any).default,
});
