Skip to content

Commit

Permalink
fix: do not display language if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreiffers committed Oct 25, 2024
1 parent 4b59a24 commit edb1b0c
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/components/details-page/components/banner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,16 @@ const Banner: FC<Props> = ({
{languages
.filter(
({ code, selected }) =>
code !== translations.getLanguage() && selected
code !== translations.getLanguage() &&
selected &&
title[code as LanguageType]
)
.map(({ code }, index) => {
const typedCode = code as LanguageType;
return (
<SC.SecondTitles>
{`${index > 0 ? ', ' : ''}${
translations.shortLang[code]
}: `}
<i>{title[typedCode]}</i>
</SC.SecondTitles>
);
})}
.map(({ code }, index) => (
<SC.SecondTitles>
{`${index > 0 ? ', ' : ''}${translations.shortLang[code]}: `}
<i>{title[code as LanguageType]}</i>
</SC.SecondTitles>
))}
</SC.SecondTitlesWrapped>
)}

Expand Down

0 comments on commit edb1b0c

Please sign in to comment.