import axios from "axios";
import React, { useEffect, useState } from "react";
import "../App.css";
const Film = () => {
  const [data, setData] = useState([]);

  useEffect(() => {
    axios.get(`https://swapi.py4e.com/api/films/`).then((res) => {
      setData(res.data.results);
      console.log(res.data.results);
    });
  }, []);
  return (
    <ul>
      {data.map((elem, index) => {
        return (
          <li id="movieStyle" key={index}>
            <p>Movie Title : {elem.title}</p>
          </li>
        );
      })}
    </ul>
  );
};

export default Film;
