12 lines
268 B
TypeScript
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];
|
|
};
|