"use strict";

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