export const useEnum = (baseEnum) => {
    const buildArray = () => {
        return Object.keys(baseEnum)
            .filter((t) => isNaN(+t))
            .map((t) => ({
            name: t.split("_").join(" "),
            value: baseEnum[t],
        }));
    };
    const array = buildArray();
    const getArray = () => {
        return array;
    };
    const getInstance = (id) => {
        return array.find((i) => i.value === id);
    };
    return {
        getArray,
        getInstance,
    };
};
