Files
pj_h5_cloud/src/sheep/hooks/use-enum.ts
T
2024-11-12 04:33:34 +08:00

12 lines
268 B
TypeScript

import { isEmpty } from "radash";
import { serviceEnum } from "../constant/index";
export const useEnum = (
key: string | undefined,
value: string | number | undefined
) => {
if (isEmpty(key) || isEmpty(value)) return "";
return serviceEnum[key!][value];
};