Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import { useEffect, useState } from react; import axios from . . / . . / utils / axios ; import requests from

import { useEffect, useState } from "react";
import axios from "../../utils/axios";
import requests from "../../utils/requests";
import { FaPlay } from "react-icons/fa";
import { IoMdInformationCircleOutline } from "react-icons/io";
import "./banner.css"
const Banner =()=>{
const [movie, setMovie]= useState({});
useEffect(()=>{
(async ()=>{
try {
const request = await axios.get(requests.fetchNetflixOriginals)
console.log("req", request)
setMovie(request.data.results[
Math.floor(Math.random()* request.data.results.length)
]);
} catch (error){
console.log("error", error);
}
})()
},[]);
function truncate(str, n){
return str?.length > n ? str.substr(0, n -1)+'...' : str;
}
return (

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Technology

Authors: Suad Alagic

1st Edition

354096276X, 978-3540962762

More Books

Students also viewed these Databases questions

Question

mple 10. Determine d dx S 0 t dt.

Answered: 1 week ago