import { useMemo } from 'react';
import useConfiguration from './useConfiguration';
/**
 * @example const testIds = useTestIds(testIdProp: 'some-test-id', getSomeComponentTestIds);
 * @param testIdProp `testId` prop passed to the component.
 * @param getTestIds Function for generating test ids for a particular component.
 * @returns An empty object or an object with a root key and camelCased keys and values based on params.
 */
const useTestIds = (testIdProp, getTestIds) => {
    const { testIds } = useConfiguration();
    return useMemo(() => {
        if (!testIds)
            return {};
        if (typeof testIdProp === 'object' && testIdProp) {
            return testIdProp;
        }
        return getTestIds(testIdProp);
    }, [testIds, testIdProp, getTestIds]);
};
export default useTestIds;
//# sourceMappingURL=useTestIds.js.map