fix(chat): add voice unlock payment choices

This commit is contained in:
2026-06-25 14:41:21 +08:00
parent 5879b7acf3
commit ffc3db9a91
7 changed files with 201 additions and 2 deletions
+4 -2
View File
@@ -18,6 +18,7 @@ export interface MessageContentProps {
isUnlockingPrivate?: boolean;
onUnlockPrivateMessage?: (messageId: string) => void;
onUnlockImagePaywall?: () => void;
onUnlockVoiceMessage?: () => void;
}
const IMAGE_PLACEHOLDER = "[图片]";
@@ -36,6 +37,7 @@ export function MessageContent({
isUnlockingPrivate = false,
onUnlockPrivateMessage,
onUnlockImagePaywall,
onUnlockVoiceMessage,
}: MessageContentProps) {
const hasImage = imageUrl != null && imageUrl.length > 0;
const hasAudio = audioUrl != null && audioUrl.length > 0;
@@ -85,8 +87,8 @@ export function MessageContent({
hint={privateMessageHint}
isUnlocking={isUnlockingPrivate}
onUnlock={
isLockedVoiceMessage && messageId
? () => onUnlockPrivateMessage?.(messageId)
isLockedVoiceMessage
? onUnlockVoiceMessage
: undefined
}
/>