import MovieCard from "./MovieCard";

export interface IMovieListProps {
  movies: Array<IMovieSearch>;
}

export default function MovieList({ movies }: IMovieListProps) {
  return (
      <div
        className={`p-1 flex justify-around flex-wrap gap-4 sm:justify-center `}
      >
        {movies.length > 0 ? (
          movies.map((m) => (
            <div className="WrapItem w-full mx-5 sm:w-64 mx-1" key={m.imdbID}>
              <MovieCard movie={m} />
            </div>
          ))
        ) : (
          <h1>Nothing to show</h1>
        )}
      </div>
  );
}
