"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useGenerateThemeStyles = void 0;
var _useDarkMode = require("./useDarkMode");
var _reactNativePaper = require("react-native-paper");
const mergeTheme = (obj1, obj2) => {
  for (let key in obj2) {
    if (obj2.hasOwnProperty(key) && obj1.hasOwnProperty(key)) {
      obj1[key] = obj2[key];
    }
  }
  return obj1;
};
const useGenerateThemeStyles = config => {
  var _config$theme;
  const theme = (0, _reactNativePaper.useTheme)();
  const {
    isDarkTheme
  } = (0, _useDarkMode.useDarkMode)();
  if (!(config !== null && config !== void 0 && (_config$theme = config.theme) !== null && _config$theme !== void 0 && _config$theme.dark) || !(config !== null && config !== void 0 && config.theme.light)) return theme;
  let themeColor;
  if (isDarkTheme) {
    themeColor = config.theme.dark;
  } else {
    themeColor = config.theme.light;
  }
  const mergedTheme = mergeTheme(theme.colors, themeColor);
  return {
    colors: mergedTheme
  };
};
exports.useGenerateThemeStyles = useGenerateThemeStyles;
//# sourceMappingURL=useGenerateThemeStyles.js.map