"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ListItemAmount = void 0;
var _reactNative = require("react-native");
var _context = require("../../context");
var _core = require("../../core");
var _accessibility = require("../../utils/accessibility");
var _icons = require("../icons");
var _typography = require("../typography");
var _jsxRuntime = require("react/jsx-runtime");
const iconMargin = 8;
const ListItemAmount = ({
  label,
  iconName,
  iconColor,
  valueElementProps,
  valueString,
  accessibilityLabel,
  testID
}) => {
  const theme = (0, _context.useIOTheme)();
  const {
    dynamicFontScale,
    spacingScaleMultiplier,
    hugeFontEnabled
  } = (0, _accessibility.useIOFontDynamicScale)();
  const listItemAccessibilityLabel = accessibilityLabel || `${label}`;
  const itemInfoTextComponent = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
    accessible: false,
    importantForAccessibility: "no-hide-descendants",
    accessibilityElementsHidden: false,
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.H6, {
      color: theme["textBody-tertiary"],
      children: label
    })
  });
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
    style: _core.IOListItemStyles.listItem,
    testID: testID,
    accessible: true,
    accessibilityLabel: listItemAccessibilityLabel,
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
      style: [_core.IOListItemStyles.listItemInner, {
        columnGap: iconMargin * dynamicFontScale * spacingScaleMultiplier
      }],
      children: [iconName && !hugeFontEnabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
        allowFontScaling: true,
        name: iconName,
        color: iconColor ?? theme["icon-decorative"],
        size: _core.IOListItemVisualParams.iconSize
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
        style: {
          flex: 1
        },
        children: itemInfoTextComponent
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.H3, {
        ...valueElementProps,
        color: theme["textBody-default"],
        accessibilityLabel: `${listItemAccessibilityLabel}; ${valueElementProps?.accessibilityLabel ?? ""}`,
        children: valueString
      })]
    })
  });
};
exports.ListItemAmount = ListItemAmount;
//# sourceMappingURL=ListItemAmount.js.map