mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
29 lines
705 B
TypeScript
29 lines
705 B
TypeScript
import Post from '../post';
|
|
import { useTranslation } from 'react-i18next';
|
|
import _ from 'lodash';
|
|
|
|
interface RulesPostProps {
|
|
subplebbitAddress: string | undefined;
|
|
createdAt: number;
|
|
rules: string[];
|
|
}
|
|
|
|
const SubplebbitRules = ({ subplebbitAddress, createdAt, rules }: RulesPostProps) => {
|
|
const { t } = useTranslation();
|
|
const content = rules.map((rule, index) => `${index + 1}. ${rule}`).join('\n');
|
|
const post = {
|
|
isRules: true,
|
|
subplebbitAddress,
|
|
timestamp: createdAt,
|
|
author: { displayName: '## Board Mods' },
|
|
content,
|
|
title: _.capitalize(t('rules')),
|
|
pinned: true,
|
|
locked: true,
|
|
};
|
|
|
|
return <Post post={post} />;
|
|
};
|
|
|
|
export default SubplebbitRules;
|