/**
 * Feature flag hook for the flights-map feature.
 *
 * Reads from environment configuration. In future phases this can be
 * extended to read from a remote feature flag service.
 *
 * @module
 */

import { getEnv } from "@/env/index.js";

/**
 * Known feature flag names.
 */
type FeatureFlagName = "flightsMap";

/**
 * Check whether a feature flag is enabled.
 * Currently backed by env vars; extend to remote config as needed.
 */
export function useFeatureFlag(flag: FeatureFlagName): boolean {
  const env = getEnv();

  switch (flag) {
    case "flightsMap":
      return env.FEATURE_FLIGHTS_MAP ?? false;
  }
}
