import { isPro } from '../Helpers';

/**
 * Custom hook for managing premium feature access
 * @returns {object} - Premium feature utilities
 */
export const usePremiumFeatures = () => {
  const proData = isPro();
  const allConditionsMet = proData;

  const checkPremiumAccess = (callback, showPremiumModal) => {
    if (!allConditionsMet) {
      showPremiumModal();
      return false;
    }
    callback();
    return true;
  };

  const isPremiumFeature = (featureName) => {
    // Define which features are premium
    const premiumFeatures = [
      'activeinstantsupport',
      'activeinstantreview', 
      'weeklydownload',
      'wpconfigmodification',
      'htaccessmodification',
      'monitor_admin_access',
      'monitor_visitor_access',
      'limit_login_attempts',
      'track_404_errors',
      'scan_uploaded_files',
      'monitor_file_integrity',
      'manualIPbloker',
      'autoIPbloker',
      'ordernotmarkedstatus',
      'couponusesnotification',
      'productdownloadnotice'
    ];
    
    return premiumFeatures.includes(featureName);
  };

  return {
    allConditionsMet,
    checkPremiumAccess,
    isPremiumFeature
  };
};