@ramses-superapp/ramses-ui
Version:
Skinless UI primitives for Ramses Built Apps
29 lines (28 loc) • 705 B
JavaScript
;
import { forwardRef } from 'react';
import { Text, View } from 'react-native';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const RsBadge = /*#__PURE__*/forwardRef(({
count,
visible = true,
children,
style
}, ref) => {
return /*#__PURE__*/_jsxs(View, {
ref: ref,
style: style,
children: [children, visible && count !== undefined && count > 0 ? /*#__PURE__*/_jsx(View, {
style: {
position: 'absolute',
top: 0,
right: 0
},
children: /*#__PURE__*/_jsx(Text, {
children: count
})
}) : null]
});
});
RsBadge.displayName = 'RsBadge';
export default RsBadge;
//# sourceMappingURL=RsBadge.js.map