if (typeof window !== 'undefined') {
  window.featureFlags = window.featureFlags || {};
}

const defaultFeatureFlags = {
  logs: false,
  showThemeToggle: false,
  watchConfigurationHiddenFields: false,
  aiWorkbenchHighlightsCreateVideo: false,
  showOldFormsInFeedModule: false,
};

export const featureFlags = new Proxy(defaultFeatureFlags, {
  get(target, prop) {
    const key = prop as keyof typeof window.featureFlags;
    return typeof window !== 'undefined'
      ? (window.featureFlags || {})[key] || window.localStorage.getItem(key)
      : target[key];
  },
});

export default {};
