summaryrefslogtreecommitdiffstats
path: root/src/components/MetaItems/PostsCount/PostsCount.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-03-01 22:08:56 +0100
committerArmand Philippot <git@armandphilippot.com>2022-03-01 22:08:56 +0100
commit80d54805e26a6a6971c5ad214b02456dcc226628 (patch)
tree9b81e0cd3ff881b2cbeb81f9f96b52b510d67646 /src/components/MetaItems/PostsCount/PostsCount.tsx
parent99ae0a9d3a923ca1e998dc9b504dad607fdfd768 (diff)
parent8bd9784acdee6871ad70e86d0d7120299bf76969 (diff)
refactor: various refactoring
Improve maintenance (meta splitting) and try to improve performance (dynamic imports).
Diffstat (limited to 'src/components/MetaItems/PostsCount/PostsCount.tsx')
-rw-r--r--src/components/MetaItems/PostsCount/PostsCount.tsx27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/components/MetaItems/PostsCount/PostsCount.tsx b/src/components/MetaItems/PostsCount/PostsCount.tsx
new file mode 100644
index 0000000..9fb1784
--- /dev/null
+++ b/src/components/MetaItems/PostsCount/PostsCount.tsx
@@ -0,0 +1,27 @@
+import { MetaKind } from '@ts/types/app';
+import { useIntl } from 'react-intl';
+import { MetaItem } from '..';
+
+const PostsCount = ({ total, kind }: { total: number; kind: MetaKind }) => {
+ const intl = useIntl();
+
+ return (
+ <MetaItem
+ title={intl.formatMessage({
+ defaultMessage: 'Total:',
+ description: 'PostCount: total found articles meta label',
+ })}
+ value={intl.formatMessage(
+ {
+ defaultMessage:
+ '{total, plural, =0 {No articles} one {# article} other {# articles}}',
+ description: 'PostCount: total found articles',
+ },
+ { total }
+ )}
+ kind={kind}
+ />
+ );
+};
+
+export default PostsCount;