RocketChat/Rocket.Chat

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

Summary

Maintainability
A
0 mins
Test Coverage
import type { OperationResult } from '@rocket.chat/rest-typings';
import type { UseQueryResult } from '@tanstack/react-query';

import { useLicenseBase } from './useLicense';

export const useIsEnterprise = (): UseQueryResult<OperationResult<'GET', '/v1/licenses.isEnterprise'>> => {
    return useLicenseBase({ select: (data) => ({ isEnterprise: Boolean(data?.license.license) }) });
};