Filter out empty manga genre

This commit is contained in:
schroda
2024-09-09 14:57:34 +02:00
parent a6976d4513
commit df5ce4b08c

View File

@@ -9,7 +9,7 @@
import FavoriteIcon from '@mui/icons-material/Favorite';
import FavoriteBorderIcon from '@mui/icons-material/FavoriteBorder';
import { styled, useTheme } from '@mui/material/styles';
import { ComponentProps, useEffect } from 'react';
import { ComponentProps, useEffect, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { t as translate } from 'i18next';
import Link from '@mui/material/Link';
@@ -177,13 +177,14 @@ const Thumbnail = ({ manga }: { manga: Partial<MangaThumbnailInfo> }) => {
const DESCRIPTION_COLLAPSED_SIZE = 75;
const DescriptionGenre = ({
manga: { description, genre: genres },
manga: { description, genre: mangaGenres },
}: {
manga: Pick<MangaType, 'description' | 'genre'>;
}) => {
const [isCollapsed, setIsCollapsed] = useLocalStorage('isDescriptionGenreCollapsed', true);
const collapsedSize = description ? DESCRIPTION_COLLAPSED_SIZE : 0;
const genres = useMemo(() => mangaGenres.filter(Boolean), [mangaGenres]);
return (
<>