"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactNative = require("react-native");
var _react = require("react");
var _styles = require("./styles");
var _reactNativePaper = require("react-native-paper");
const CustomSocialTab = ({
  tabNames,
  onTabChange,
  activeTab
}) => {
  const styles = (0, _styles.useStyles)();
  const theme = (0, _reactNativePaper.useTheme)();
  return /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.tabContainer
  }, /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
    horizontal: true,
    showsHorizontalScrollIndicator: false
  }, tabNames.map(tabName => {
    const onPressTab = () => {
      onTabChange(tabName);
    };
    const pressedBtnStyle = activeTab === tabName && {
      backgroundColor: theme.colors.primary
    };
    const pressedTabName = activeTab === tabName && {
      color: '#ffffff'
    };
    return /*#__PURE__*/React.createElement(_reactNative.TouchableOpacity, {
      style: [styles.tabBtn, pressedBtnStyle],
      onPress: onPressTab,
      key: tabName
    }, /*#__PURE__*/React.createElement(_reactNative.Text, {
      style: [styles.tabName, pressedTabName]
    }, tabName));
  })));
};
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(CustomSocialTab);
//# sourceMappingURL=CustomSocialTab.js.map