Files
5chan/src/components/subplebbit-description/subplebbit-description.tsx
T

31 lines
845 B
TypeScript
Raw Normal View History

import Post from '../post';
import { useTranslation } from 'react-i18next';
2024-04-12 14:28:06 +02:00
interface DescriptionPostProps {
avatarUrl?: string;
createdAt: number;
description: string;
shortAddress: string;
subplebbitAddress: string | undefined;
title: string;
}
const SubplebbitDescription = ({ avatarUrl, createdAt, description, shortAddress, subplebbitAddress, title }: DescriptionPostProps) => {
const { t } = useTranslation();
const post = {
isDescription: true,
subplebbitAddress,
timestamp: createdAt,
author: { displayName: '## Board Mods' },
content: description,
link: avatarUrl,
title: t('welcome_to_board', { board: title || `p/${shortAddress}`, interpolation: { escapeValue: false } }),
pinned: true,
locked: true,
};
return <Post post={post} />;
};
export default SubplebbitDescription;