"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Pre = void 0;
var _react = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _useTheme = require("../theme/use-theme.js");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
/**
 * Block-level monospace text — render as `<pre>` on web (CSS var family)
 * and `<View><Text fontFamily="Geist Mono"></View>` on native.
 */
const PreComponent = function Pre({
  children,
  containerStyle,
  style,
  ...rest
}) {
  const {
    colors
  } = (0, _useTheme.useTheme)();
  if (_reactNative.Platform.OS === 'web') {
    return /*#__PURE__*/_react.default.createElement('pre', {
      ...rest,
      style: {
        fontFamily: 'var(--bloom-font-mono)',
        fontSize: '0.92em',
        color: colors.text,
        backgroundColor: colors.backgroundSecondary,
        padding: '12px 16px',
        borderRadius: 8,
        overflow: 'auto',
        margin: 0,
        ...containerStyle,
        ...style
      }
    }, children);
  }
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
    style: [{
      backgroundColor: colors.backgroundSecondary,
      padding: 12,
      borderRadius: 8
    }, containerStyle],
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
      ...rest,
      style: [{
        fontFamily: 'Geist Mono',
        fontSize: 13,
        color: colors.text
      }, style],
      children: children
    })
  });
};
const Pre = exports.Pre = /*#__PURE__*/(0, _react.memo)(PreComponent);
Pre.displayName = 'Pre';
//# sourceMappingURL=Pre.js.map