RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/hooks/useHasLicenseModule.ts

Summary

Maintainability
A
0 mins
Test Coverage
import type { LicenseModule } from '@rocket.chat/core-typings';

import { useLicenseBase } from './useLicense';

export const useHasLicenseModule = (licenseName: LicenseModule): 'loading' | boolean => {
    return (
        useLicenseBase({
            select: (data) => data.license.activeModules.includes(licenseName),
        }).data ?? 'loading'
    );
};