Extract list card content

This commit is contained in:
schroda
2025-04-25 01:05:43 +02:00
parent c0ab5f93a1
commit 1b7338f5e3
7 changed files with 42 additions and 60 deletions

View File

@@ -9,7 +9,6 @@
import Box from '@mui/material/Box';
import CardActionArea from '@mui/material/CardActionArea';
import Card from '@mui/material/Card';
import CardContent from '@mui/material/CardContent';
import { Link } from 'react-router-dom';
import { memo } from 'react';
import { DownloadStateIndicator } from '@/modules/core/components/DownloadStateIndicator.tsx';
@@ -20,6 +19,7 @@ import { ChapterCardMetadata } from '@/modules/chapter/components/cards/ChapterC
import { ChapterDownloadButton } from '@/modules/chapter/components/buttons/ChapterDownloadButton.tsx';
import { ChapterDownloadRetryButton } from '@/modules/chapter/components/buttons/ChapterDownloadRetryButton.tsx';
import { Chapters } from '@/modules/chapter/services/Chapters.ts';
import { ListCardContent } from '@/modules/core/components/cards/list/ListCardContent.tsx';
export const ChapterUpdateCard = memo(({ chapter }: { chapter: ChapterUpdateListFieldsFragment }) => {
const { manga } = chapter;
@@ -34,14 +34,7 @@ export const ChapterUpdateCard = memo(({ chapter }: { chapter: ChapterUpdateList
color: (theme) => theme.palette.text[chapter.isRead ? 'disabled' : 'primary'],
}}
>
<CardContent
sx={{
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
padding: 1.5,
}}
>
<ListCardContent sx={{ justifyContent: 'space-between' }}>
<Box sx={{ display: 'flex', flexGrow: 1, gap: 1 }}>
<ChapterCardThumbnail
mangaId={manga.id}
@@ -54,7 +47,7 @@ export const ChapterUpdateCard = memo(({ chapter }: { chapter: ChapterUpdateList
<DownloadStateIndicator chapterId={chapter.id} />
<ChapterDownloadRetryButton chapterId={chapter.id} />
<ChapterDownloadButton chapterId={chapter.id} isDownloaded={chapter.isDownloaded} />
</CardContent>
</ListCardContent>
</CardActionArea>
</Card>
);