UNPKG

@hc.ds/mobile

Version:
31 lines 1.29 kB
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 React from 'react'; import { Pressable, Text, View } from 'react-native'; import { TagTheme } from './theme'; import { Flex } from '@ant-design/react-native'; export const Tag = ({ theme = 'primary', children, className, closable, onClose, testID = 'default', ...props }) => { const Content = /*#__PURE__*/React.createElement(View, _extends({ className: className, style: [TagTheme.common, TagTheme[theme], closable && TagTheme.closable], testID: `hcds-mobile-tag-${testID}` }, props), /*#__PURE__*/React.createElement(Flex, { justify: "around", align: "center" }, /*#__PURE__*/React.createElement(Text, { style: [TagTheme.textStyles] }, children), closable && /*#__PURE__*/React.createElement(Text, { style: [TagTheme.closeIcon] }, "\xD7"))); return closable ? /*#__PURE__*/React.createElement(Pressable, { onPress: onClose }, Content) : Content; }; //# sourceMappingURL=tag.js.map