fix: handle empty block content in MessageTranslate component

This commit is contained in:
Pleasurecruise 2025-05-22 17:34:23 +08:00 committed by 亢奋猫
parent 058c1e9de7
commit cc9b301fd4

View File

@ -14,16 +14,12 @@ interface Props {
const MessageTranslate: FC<Props> = ({ block }) => {
const { t } = useTranslation()
if (!block.content) {
return null
}
return (
<Fragment>
<Divider style={{ margin: 0, marginBottom: 10 }}>
<TranslationOutlined />
</Divider>
{block.content === t('translate.processing') ? (
{!block.content || block.content === t('translate.processing') ? (
<SvgSpinners180Ring color="var(--color-text-2)" style={{ marginBottom: 15 }} />
) : (
<Markdown block={block} />