"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.UserName = exports.SystemMessageText = exports.SystemMessage = exports.MessageTimestamp = exports.MessageText = exports.MessagePhotoContainer = exports.MessagePhoto = exports.MessageContainer = exports.MessageBubble = void 0;
var _react = _interopRequireWildcard(require("react"));
var _native = _interopRequireDefault(require("styled-components/native"));
var _reactNative = require("react-native");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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); }
const MessageContainer = exports.MessageContainer = _native.default.View`
  display: flex;
  flex-direction: ${props => !props.isUser ? 'row' : 'row-reverse'};
  align-items: center;
  margin: 10px 0;
  width: 100%;
`;
const MessageBubble = exports.MessageBubble = _native.default.View`
  background-color: ${props => !props.isUser ? '#f1f0f0' : '#0052CD'};
  color: ${props => !props.isUser ? '#000' : '#fff'};
  border-radius: 12px;
  padding: 10px;
  max-width: 60%;
`;
const MessageText = exports.MessageText = _native.default.View`
  margin: 0;
  flex-wrap: wrap;
`;
const UserName = exports.UserName = _native.default.Text`
  font-weight: bold;
  color: ${props => props.color ? props.color : props.isUser ? '#0052CD' : '#333'};
  margin-right: 8px;
`;
const MessageTimestamp = exports.MessageTimestamp = _native.default.Text`
  font-size: 13px;
  color: #999;
  margin-left: 8px;
`;
const MessagePhoto = exports.MessagePhoto = _native.default.Image`
  max-width: 100%;
  border-radius: 8px;
  margin-top: 8px;
`;
const MessagePhotoContainer = exports.MessagePhotoContainer = _native.default.Text`
  max-width: 100px;
  margin: 0;
`;
const SystemMessage = exports.SystemMessage = _native.default.Text`
  background-color: #e0e0e0;
  color: #555;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  margin: 10px 0;
  max-width: 60%;
`;
const SystemMessageText = exports.SystemMessageText = _native.default.Text`
  margin: 0;
  font-size: 14px;
  color: #333;
`;
const CustomMessageExample = /*#__PURE__*/(0, _react.forwardRef)(({
  message,
  isUser
}, ref) => {
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
    ref: ref,
    style: [{
      flexDirection: isUser ? 'row-reverse' : 'row',
      alignItems: 'center',
      marginVertical: 10,
      width: '100%'
    }],
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(MessageBubble, {
      isUser: isUser,
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(UserName, {
        isUser: isUser,
        children: message.user.name
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(MessageText, {
        children: message.body
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(MessageTimestamp, {
        children: message.timestamp
      })]
    })
  });
});
var _default = exports.default = CustomMessageExample;
//# sourceMappingURL=CustomMessage.js.map