-
- {children.map((child, index) => (
-
+
+ {heading && (
+
+ {icon && (
+
+ {icon}
+
+ )}
+
- {child}
-
- ))}
-
+ {heading}
+
+
+ )}
+
+ {totalPages > 1 && (
+
+
+
+
+ )}
- {/* Navigation arrows */}
- {showArrows && totalItems > itemsVisible && (
- <>
-
-
- >
- )}
+
+ {currentMovies}
+
- {/* Dot indicators */}
- {showDots && totalItems > itemsVisible && (
-
- {Array.from({ length: Math.ceil(totalItems / itemsVisible) }).map(
- (_, index) => (
+ {totalPages > 1 && (
+
+
+ {Array.from({ length: totalPages }, (_, i) => (
)}
);
};
+
+const colorsMap = {
+ yellow: "bg-gradient-to-r from-yellow-400 to-orange-400",
+ blue: "bg-gradient-to-r from-blue-400 to-purple-400",
+ green: "bg-gradient-to-r from-green-400 to-teal-400",
+ red: "bg-gradient-to-r from-red-400 to-pink-400",
+ purple: "bg-gradient-to-r from-purple-400 to-pink-400",
+ orange: "bg-gradient-to-r from-orange-400 to-yellow-400",
+ pink: "bg-gradient-to-r from-pink-400 to-purple-400",
+ teal: "bg-gradient-to-r from-teal-400 to-green-400",
+ gray: "bg-gradient-to-r from-gray-400 to-gray-400",
+};
diff --git a/src/components/molecules/RecommendedMovies/index.tsx b/src/components/molecules/RecommendedMovies/index.tsx
index b7962a1..e7a249d 100644
--- a/src/components/molecules/RecommendedMovies/index.tsx
+++ b/src/components/molecules/RecommendedMovies/index.tsx
@@ -1,68 +1,27 @@
"use client";
-
import { SearchResult } from "@/lib/tmdb/types";
import { MovieCard } from "@/components/atoms/MovieCard";
-import { FC, useState } from "react";
-import { FaChevronLeft, FaChevronRight, FaStar } from "react-icons/fa";
+import { FC } from "react";
+import { FaStar } from "react-icons/fa";
+import { Carousel } from "../Carousel";
type Props = {
movies: SearchResult;
};
export const RecommendedMovies: FC
= ({ movies }) => {
- const [currentPage, setCurrentPage] = useState(0);
- const moviesPerPage = 4;
- const totalPages = Math.ceil(movies.results.length / moviesPerPage);
-
if (!movies.results.length) return null;
- const currentMovies = movies.results.slice(
- currentPage * moviesPerPage,
- (currentPage + 1) * moviesPerPage
- );
-
- const nextPage = () => {
- setCurrentPage((prev) => (prev + 1) % totalPages);
- };
-
- const prevPage = () => {
- setCurrentPage((prev) => (prev - 1 + totalPages) % totalPages);
- };
-
return (
-
-
-
-
-
-
- Rekomendowane filmy
-
-
-
- {totalPages > 1 && (
-
-
-
-
- )}
-
-
-
- {currentMovies.map((movie) => (
+ }
+ iconColor="bg-gradient-to-r from-yellow-500 to-orange-500"
+ >
+ {movies.results.map((movie) => (
= ({ movies }) => {
favorite={false}
/>
))}
-
-
- {totalPages > 1 && (
-
-
- {Array.from({ length: totalPages }, (_, i) => (
-
-
- )}
+
diff --git a/src/components/organisms/Navbar/components/Search/index.tsx b/src/components/organisms/Navbar/components/Search/index.tsx
index a1cdc9b..543fd10 100644
--- a/src/components/organisms/Navbar/components/Search/index.tsx
+++ b/src/components/organisms/Navbar/components/Search/index.tsx
@@ -22,7 +22,6 @@ export const Search = () => {
const pathname = usePathname();
useEffect(() => {
- console.log("pathname", pathname);
setIsSearchOpen(false);
}, [pathname]);