You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
549 B
35 lines
549 B
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
|
|
export default function TagInUse(props) {
|
|
const {
|
|
label,
|
|
labelPlural,
|
|
count
|
|
} = props;
|
|
|
|
if (count === 0) {
|
|
return null;
|
|
}
|
|
|
|
if (count > 1 && labelPlural) {
|
|
return (
|
|
<div>
|
|
{count} {labelPlural.toLowerCase()}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<div>
|
|
{count} {label.toLowerCase()}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
TagInUse.propTypes = {
|
|
label: PropTypes.string.isRequired,
|
|
labelPlural: PropTypes.string,
|
|
count: PropTypes.number.isRequired
|
|
};
|