style(post): translate link types, anonymous displayName

This commit is contained in:
plebeius.eth
2024-04-28 17:40:05 +02:00
parent 190125f0d2
commit a949b5096a
3 changed files with 34 additions and 15 deletions
+15
View File
@@ -11,6 +11,21 @@ export interface CommentMediaInfo {
patternThumbnailUrl?: string;
}
export const getDisplayMediaInfoType = (type: string, t: any) => {
switch (type) {
case 'image':
return t('image');
case 'iframe':
return t('iframe');
case 'video':
return t('video');
case 'audio':
return t('audio');
default:
return t('webpage');
}
};
export const getHasThumbnail = (commentMediaInfo: CommentMediaInfo | undefined, link: string | undefined): boolean => {
const iframeThumbnail = commentMediaInfo?.patternThumbnailUrl || commentMediaInfo?.thumbnail;
return link &&