import type { Movie } from "../../../types";
import GroupMoviesListItem from "./GroupMoviesListItem";

interface GroupMoviesListProps {
	movies: Movie[];
	onClick?: (movie: Movie) => void;
}

export default function GroupMoviesList({
	movies,
	onClick,
}: GroupMoviesListProps) {
	const items = movies.map((elt) => (
		<GroupMoviesListItem key={elt.id} item={elt} onClick={onClick} />
	));

	return <div className="list-group">{items}</div>;
}
