import { observer } from 'mobx-react';
import KPISettings from './KPISettings';
import { bu, KPISubjects } from '../../libs/ht';

const sort = { DateType: 10, years: 11 };
const yearInitial = {};
const searchFormItemSet = {
  'bu': { shows: ['DateType', 'years', 'HTBusinessUnits'], sort },
  'dept': { shows: ['DateType', 'years', 'DepartmentList'], sort, fieldProps: { DepartmentList: { allowClear: true,isLeaf: true, show_all: false } }, },
  'operator': { shows: ['DateType', 'years', 'DepartmentList', 'operator'], fieldProps: { DepartmentList: { allowClear: true, isLeaf: true }, operator: { param: { is_assign: 1 } } }, sort },
  'destination': { shows: ['DateType', 'years', 'destination'], sort },
  'country': { shows: ['DateType', 'years', 'country'], sort },
};

export default observer((props) => {
  const searchProps = searchFormItemSet?.[props.curObject] || { shows: ['DateType', 'years',] , sort };
  return (
    <>
      <KPISettings {...{ searchProps, KPISubjects }} {...props} />
    </>
  );
});
