style: Update VideoCard component props and logic
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -131,6 +131,7 @@ const CollectionPage: React.FC<CollectionPageProps> = ({ collections, videos, on
|
||||
collections={collections}
|
||||
onDeleteVideo={onDeleteVideo}
|
||||
showDeleteButton={true}
|
||||
disableCollectionGrouping={true}
|
||||
/>
|
||||
</Grid>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user