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