import * as React from 'react';

export interface UseEnhancedOptions {
  enhanced: boolean;
}

export const useEnhanced = (options: UseEnhancedOptions) => {
  const { enhanced: enhancedProp } = options;
  const [enhanced, setEnhanced] = React.useState(false);
  React.useEffect(() => {
    setEnhanced(enhancedProp);
  }, [enhancedProp]);

  return React.useMemo(() => ({
    enhanced,
  }), [enhanced]);
};
