export const FEATURE_FLAG_KEYS = [
  'section_home_enabled',
  'section_map_enabled',
  'section_quick_snap_enabled',
  'section_reports_enabled',
  'section_settings_enabled',
  'feature_ai_matching_enabled',
  'feature_referrals_enabled',
  'feature_rewarded_ads_enabled',
  'feature_community_chat_enabled',
  'feature_vets_enabled',
] as const;

export type FeatureFlagKey = (typeof FEATURE_FLAG_KEYS)[number];
export type FeatureFlagsMap = Record<FeatureFlagKey, boolean>;

export const FEATURE_FLAG_DEFAULTS: FeatureFlagsMap = {
  section_home_enabled: true,
  section_map_enabled: true,
  section_quick_snap_enabled: true,
  section_reports_enabled: true,
  section_settings_enabled: true,
  feature_ai_matching_enabled: true,
  feature_referrals_enabled: true,
  feature_rewarded_ads_enabled: true,
  feature_community_chat_enabled: true,
  feature_vets_enabled: true,
};

export const FEATURE_FLAG_DESCRIPTIONS: Record<FeatureFlagKey, string> = {
  section_home_enabled: 'Controls Home tab and its section-level entry points',
  section_map_enabled: 'Controls Map tab access',
  section_quick_snap_enabled: 'Controls Quick Snap tab and backend quick-snap endpoints',
  section_reports_enabled: 'Controls report/profile/claim section and related APIs',
  section_settings_enabled: 'Controls Settings tab visibility',
  feature_ai_matching_enabled: 'Controls AI matching and scan endpoints',
  feature_referrals_enabled: 'Controls referral rewards endpoints and UI entry points',
  feature_rewarded_ads_enabled: 'Controls rewarded-ad based bonus flows',
  feature_community_chat_enabled: 'Controls conversation/chat endpoints',
  feature_vets_enabled: 'Controls vets and shelters public directory endpoints',
};

export function isFeatureFlagKey(value: string): value is FeatureFlagKey {
  return (FEATURE_FLAG_KEYS as readonly string[]).includes(value);
}
