"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.CommunityProfileTab = void 0;
var _react = require("react");
var _reactNative = require("react-native");
var _reactNativeSvg = require("react-native-svg");
var _icons = require("../../../../../core/assets/icons");
var _IconTab = _interopRequireDefault(require("../../../../components/IconTab/IconTab"));
var _enums = require("../../../../enums");
var _hooks = require("../../../../hooks");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
let CommunityProfileTab = exports.CommunityProfileTab = /*#__PURE__*/function (CommunityProfileTab) {
  CommunityProfileTab["community_feed"] = "community_feed";
  CommunityProfileTab["community_pin"] = "community_pin";
  CommunityProfileTab["community_image_feed"] = "community_image_feed";
  CommunityProfileTab["community_video_feed"] = "community_video_feed";
  return CommunityProfileTab;
}({});
const AmityCommunityProfileTabComponent = ({
  pageId = _enums.PageID.WildCardPage,
  componentId = _enums.ComponentID.WildCardComponent,
  currentTab,
  onTabChange
}) => {
  const elementId = _enums.ElementID.community_profile_tab;
  const {
    themeStyles,
    accessibilityId
  } = (0, _hooks.useAmityElement)({
    pageId,
    componentId,
    elementId
  });
  const styles = _reactNative.StyleSheet.create({
    container: {
      backgroundColor: themeStyles === null || themeStyles === void 0 ? void 0 : themeStyles.colors.background,
      flexDirection: 'row',
      width: '100%',
      paddingHorizontal: 16,
      justifyContent: 'space-between',
      borderBottomColor: themeStyles === null || themeStyles === void 0 ? void 0 : themeStyles.colors.baseShade4,
      borderBottomWidth: 1
    }
  });
  const getActiveColor = (0, _react.useCallback)(isActive => {
    return isActive ? themeStyles === null || themeStyles === void 0 ? void 0 : themeStyles.colors.base : themeStyles === null || themeStyles === void 0 ? void 0 : themeStyles.colors.baseShade2;
  }, [themeStyles]);
  return /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.container,
    testID: accessibilityId,
    accessibilityLabel: accessibilityId
  }, /*#__PURE__*/React.createElement(_reactNative.Pressable, {
    onPress: () => onTabChange(CommunityProfileTab.community_feed)
  }, /*#__PURE__*/React.createElement(_IconTab.default, {
    themeStyles: themeStyles,
    icon: /*#__PURE__*/React.createElement(_reactNativeSvg.SvgXml, {
      xml: (0, _icons.feed)(),
      width: 24,
      height: 24,
      color: getActiveColor(currentTab === CommunityProfileTab.community_feed)
    }),
    isActive: currentTab === CommunityProfileTab.community_feed
  })), /*#__PURE__*/React.createElement(_reactNative.Pressable, {
    onPress: () => onTabChange(CommunityProfileTab.community_pin)
  }, /*#__PURE__*/React.createElement(_IconTab.default, {
    themeStyles: themeStyles,
    icon: /*#__PURE__*/React.createElement(_reactNativeSvg.SvgXml, {
      width: 24,
      height: 24,
      xml: (0, _icons.pin)(),
      color: getActiveColor(currentTab === CommunityProfileTab.community_pin)
    }),
    isActive: currentTab === CommunityProfileTab.community_pin
  })), /*#__PURE__*/React.createElement(_reactNative.Pressable, {
    onPress: () => onTabChange(CommunityProfileTab.community_image_feed)
  }, /*#__PURE__*/React.createElement(_IconTab.default, {
    themeStyles: themeStyles,
    icon: /*#__PURE__*/React.createElement(_reactNativeSvg.SvgXml, {
      width: 24,
      height: 24,
      xml: (0, _icons.image)(),
      color: getActiveColor(currentTab === CommunityProfileTab.community_image_feed)
    }),
    isActive: currentTab === CommunityProfileTab.community_image_feed
  })), /*#__PURE__*/React.createElement(_reactNative.Pressable, {
    onPress: () => onTabChange(CommunityProfileTab.community_video_feed)
  }, /*#__PURE__*/React.createElement(_IconTab.default, {
    themeStyles: themeStyles,
    icon: /*#__PURE__*/React.createElement(_reactNativeSvg.SvgXml, {
      width: 24,
      height: 24,
      xml: (0, _icons.mediaIcon)(),
      color: getActiveColor(currentTab === CommunityProfileTab.community_video_feed)
    }),
    isActive: currentTab === CommunityProfileTab.community_video_feed
  })));
};
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(AmityCommunityProfileTabComponent);
//# sourceMappingURL=Tab.js.map