fix: show deletion reason as primary text on redacted messages

This commit is contained in:
root
2026-05-15 14:39:16 -04:00
parent 243a1c78c1
commit 7aee1f07f1
3 changed files with 7 additions and 23 deletions
@@ -40,12 +40,11 @@ export function MBadEncrypted() {
type RedactedContentProps = {
reason?: string;
originalBody?: string;
};
export function RedactedContent({ reason, originalBody }: RedactedContentProps) {
export function RedactedContent({ reason }: RedactedContentProps) {
return (
<Text>
<MessageDeletedContent reason={reason} originalBody={originalBody} />
<MessageDeletedContent reason={reason} />
</Text>
);
}
@@ -4,14 +4,12 @@ import React from 'react';
const warningStyle = { color: color.Warning.Main, opacity: config.opacity.P300 };
const criticalStyle = { color: color.Critical.Main, opacity: config.opacity.P300 };
export const MessageDeletedContent = as<'div', { children?: never; reason?: string; originalBody?: string }>(
({ reason, originalBody, ...props }, ref) => (
export const MessageDeletedContent = as<'div', { children?: never; reason?: string }>(
({ reason, ...props }, ref) => (
<Box as="span" alignItems="Center" gap="100" style={warningStyle} {...props} ref={ref}>
<Icon size="50" src={Icons.Delete} />
{originalBody ? (
<s>{originalBody.length > 80 ? `${originalBody.slice(0, 80)}` : originalBody}</s>
) : reason ? (
<i>This message has been deleted. {reason}</i>
{reason ? (
<i>{reason}</i>
) : (
<i>This message has been deleted</i>
)}