UNPKG

fastcomments-react-native-sdk

Version:

React Native FastComments Components. Add live commenting to any React Native application.

12 lines (11 loc) 569 B
import { jsx as _jsx } from "react/jsx-runtime"; import { Text } from 'react-native'; export function CommentCount({ state, style, count }) { const configFormat = state.config.commentCountFormat.get(); if (configFormat) { return _jsx(Text, { style: style, children: configFormat.replace('[count]', Number(count).toLocaleString()) }); } else { return _jsx(Text, { style: style, children: Number(count).toLocaleString() + (count === 1 ? state.translations.COMMENT_THIS_PAGE.get() : state.translations.COMMENTS_THIS_PAGE.get()) }); } }