function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import * as React from "react";
import { Platform, StyleSheet, TouchableWithoutFeedback, View } from "react-native";
import Text from "../Typography/Text";
import { colors } from "../../styles/tokens";
import { withTheme } from "../../core/theming";
const HeaderContent = _ref => {
  let {
    color: titleColor,
    subtitle,
    subtitleStyle,
    onPress,
    style,
    titleRef,
    titleStyle,
    theme,
    title,
    ...rest
  } = _ref;
  const titleTextColor = titleColor ? titleColor : colors.white;
  return /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
    accessibilityRole: "button",
    onPress: onPress,
    disabled: !onPress
  }, /*#__PURE__*/React.createElement(View, _extends({
    pointerEvents: "box-none",
    style: [styles.container, style]
  }, rest), /*#__PURE__*/React.createElement(Text, {
    ref: titleRef,
    variant: "Small",
    style: [{
      color: titleTextColor,
      ...theme.fonts.bold
    }, titleStyle],
    numberOfLines: 1,
    accessible: true
    // @ts-ignore Type '"heading"' is not assignable to type ...
    ,
    accessibilityRole: Platform.OS === "web" ? "heading" : "header"
  }, title), subtitle ? /*#__PURE__*/React.createElement(Text, {
    variant: "XSmall",
    style: [{
      color: theme.colors.fg.subtle
    }, subtitleStyle],
    numberOfLines: 1
  }, subtitle) : null));
};
HeaderContent.displayName = "Header.Content";
const styles = StyleSheet.create({
  container: {
    flex: 1,
    paddingHorizontal: 12
  },
  title: {
    fontSize: Platform.OS === "ios" ? 17 : 20
  },
  subtitle: {
    fontSize: Platform.OS === "ios" ? 11 : 14
  }
});
export default withTheme(HeaderContent);

// @component-docs ignore-next-line
const HeaderContentWithTheme = withTheme(HeaderContent);
// @component-docs ignore-next-line
export { HeaderContentWithTheme as HeaderContent };
//# sourceMappingURL=HeaderContent.js.map