/*
 * @Author: cclu
 * @Date: 2022-06-24 21:16:47
 * @LastEditors: zzy 411037547@qq.com
 * @LastEditTime: 2022-06-27 11:13:03
 * @FilePath: \cloud-platform\src\pages\merchantManagement\category\index.tsx
 * @Description: 用户自定义类别页面
 */

import CategoryTable from "./Base"
import useRequest from '@ahooksjs/use-request';
import { getFieldEnum } from "@/services/options";

const CategoryHome: React.FC = (props: any) => {
    const categoryType = props.match.params.id // 类别类型

    const { loading: typeLoading, data: typeName } = useRequest(async () => {
        const data = await getFieldEnum({ FieldExplainField: 'CUSTOMTYPE_TYPE' })
        const typeOption = data.find(n => `${n.value}` === categoryType)
        return typeOption?.label
    })

    return typeLoading ? <></> : <CategoryTable typeName={typeName} categoryType={categoryType} />
}
export default CategoryHome