From 8315b54f49ca3bb10664ab0b561d9fa697234394 Mon Sep 17 00:00:00 2001 From: DS Boyce <260543580+ds-boyce@users.noreply.github.com> Date: Tue, 3 Mar 2026 15:53:37 -0800 Subject: [PATCH] Use a switch for returns --- src/components/Post/Translated/index.tsx | 67 +++++++++++------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/src/components/Post/Translated/index.tsx b/src/components/Post/Translated/index.tsx index 37576750fd..6c4cdd9c98 100644 --- a/src/components/Post/Translated/index.tsx +++ b/src/components/Post/Translated/index.tsx @@ -46,42 +46,39 @@ export function TranslatedPost({ [post, langPrefs.primaryLanguage], ) - if (translationState.status === 'error') { - return ( - - ) + switch (translationState.status) { + case 'loading': + return + case 'success': + return ( + + ) + case 'error': + return ( + + ) + default: + return ( + needsTranslation && ( + + ) + ) } - - if (translationState.status === 'loading') { - return - } - - if (translationState.status === 'success') { - return ( - - ) - } - - return ( - needsTranslation && ( - - ) - ) } function TranslationLoading() {