style: Update VideoCard component props and logic

This commit is contained in:
Peifan Li
2025-11-22 20:00:00 -05:00
parent 3f63f28210
commit d97bbde963
3 changed files with 6 additions and 3 deletions

View File

@@ -314,7 +314,7 @@ function App() {
}
setIsSearchMode(false);
showSnackbar('Video added successfully');
showSnackbar('Video downloading');
return { success: true };
} catch (err: any) {
console.error('Error downloading video:', err);

View File

@@ -27,13 +27,15 @@ interface VideoCardProps {
collections?: Collection[];
onDeleteVideo?: (id: string) => Promise<void>;
showDeleteButton?: boolean;
disableCollectionGrouping?: boolean;
}
const VideoCard: React.FC<VideoCardProps> = ({
video,
collections = [],
onDeleteVideo,
showDeleteButton = false
showDeleteButton = false,
disableCollectionGrouping = false
}) => {
const navigate = useNavigate();
const theme = useTheme();
@@ -90,7 +92,7 @@ const VideoCard: React.FC<VideoCardProps> = ({
);
// Check if this video is the first in any collection
const isFirstInAnyCollection = videoCollections.some(collection =>
const isFirstInAnyCollection = !disableCollectionGrouping && videoCollections.some(collection =>
collection.videos[0] === video.id
);

View File

@@ -131,6 +131,7 @@ const CollectionPage: React.FC<CollectionPageProps> = ({ collections, videos, on
collections={collections}
onDeleteVideo={onDeleteVideo}
showDeleteButton={true}
disableCollectionGrouping={true}
/>
</Grid>
))}