aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Genre.tsx
diff options
context:
space:
mode:
authorAlberto-Duarte <alberto@albertoduarte.com>2023-04-25 16:27:11 +0100
committerAlberto-Duarte <alberto@albertoduarte.com>2023-04-25 16:27:11 +0100
commit66412b7788f49def33fc2143f9e1bd5d25bac261 (patch)
tree84b23113389f823533176319c311bed8437be75c /src/components/Genre.tsx
parent1b3a300173c4531bebf3b88966a1fec64d276440 (diff)
added more things jaja
Diffstat (limited to 'src/components/Genre.tsx')
-rw-r--r--src/components/Genre.tsx27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/components/Genre.tsx b/src/components/Genre.tsx
new file mode 100644
index 0000000..e63a26a
--- /dev/null
+++ b/src/components/Genre.tsx
@@ -0,0 +1,27 @@
+import { useEffect, useState } from "react"
+
+const Genres = ({id}) => {
+
+ const baseURL = 'https://api.themoviedb.org/3'
+ const API_KEY = '8216fbb9997cd81a67471e6cb5a6f2df'
+ const [genres, setGenres] = useState()
+
+ useEffect(() => {
+ fetch(`${baseURL}/movie/${id}?api_key=${API_KEY}`).then((res) => res.json()).then((data) => {
+ console.log('MOVIE', data.genres)
+ setGenres(data.genres)
+ })
+ }, [])
+
+ return (
+ <div className="text-white/60 gap-x-3 text-xs flex flex-row flex-wrap relative">
+ {genres?.map((genre) => {
+ return (
+ <div>{genre.name}</div>
+ )
+ })}
+ </div>
+ )
+}
+
+export default Genres \ No newline at end of file