import React from 'react'; import PropTypes from 'prop-types'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons'; import { UncontrolledTooltip } from 'reactstrap'; import { serverType } from '../../servers/prop-types'; import { shortUrlType } from '../reducers/shortUrlsList'; import './ShortUrlVisitsCount.scss'; import VisitStatsLink from './VisitStatsLink'; const propTypes = { visitsCount: PropTypes.number.isRequired, shortUrl: shortUrlType, selectedServer: serverType, }; const ShortUrlVisitsCount = ({ visitsCount, shortUrl, selectedServer }) => { const maxVisits = shortUrl && shortUrl.meta && shortUrl.meta.maxVisits; const visitsLink = ( {visitsCount} ); if (!maxVisits) { return visitsLink; } return ( {visitsLink} {' '}/ {maxVisits}{' '} This short URL will not accept more than {maxVisits} visits. ); }; ShortUrlVisitsCount.propTypes = propTypes; export default ShortUrlVisitsCount;