import {DictionaryParamsType} from '@models';
import {DictionaryParams} from '@routes';
import {useParams} from 'react-router-dom';

export function useDicionaryType(): DictionaryParamsType {
  const pathParams = useParams<{type: DictionaryParams}>();

  switch (pathParams.type!) {
    case 'type':
      return '物料类型';
    case 'corporation':
      return '公司';
    case 'department':
      return '部门字典';
    case 'inventory':
      return '库存组织';
    case 'storehouse':
      return '仓库';
    case 'wbs':
      return 'WBS字典';
    case 'supplier':
      return '供应商/客户';
    case 'unit':
      return '计量单位';
  }
}
