Advertisement
justfrenzy

CrackFlix - frontend /src/components/App/MediaList.tsx

May 12th, 2024
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TypeScript 1.33 KB | Source Code | 0 0
  1. import { Link } from "@nextui-org/react";
  2. import AdsComponent from "../HomePage/AdsComponent";
  3. import { mediaType } from "./props.interface";
  4. import CardComponent from "./CardComponent";
  5. // import { useNavigate } from "react-router-dom";
  6.  
  7. type MediaListTypes = {
  8.     title: string;
  9.     data: mediaType[];
  10.     onOpen: () => void;
  11.     setMediaId: React.Dispatch<React.SetStateAction<number>>;
  12.     isMovie: boolean;
  13. };
  14.  
  15. const MediaList: React.FC<MediaListTypes> = ({
  16.     title,
  17.     data,
  18.     onOpen,
  19.     setMediaId,
  20.     isMovie
  21. }) => {
  22.     return (
  23.         <div className="flex flex-col md:flex-row gap-4 py-[10px] sm:px-[40px] px-[10px] z-0">
  24.             <div className="flex justify-between">
  25.                 <div className="flex flex-col">
  26.                     <div className="flex flex-row items-center gap-3 justify-start mb-4">
  27.                         <Link
  28.                             className="cursor-pointer text-4xl font-bold rounded-full"
  29.                             color="primary"
  30.                         >
  31.                             {title}
  32.                         </Link>
  33.                     </div>
  34.                     <div className="grid gap-3 grid-cols-2 sm:grid-cols-4 md:grid-cols-6">
  35.                         {data?.map((item) => (
  36.                             <CardComponent
  37.                                 key={item.id}
  38.                                 data={item}
  39.                                 onOpen={onOpen}
  40.                                 setMediaId={setMediaId}
  41.                                 isMovie={isMovie}
  42.                             />
  43.                         ))}
  44.                     </div>
  45.                 </div>
  46.             </div>
  47.             {/* Render the ads component */}
  48.             <AdsComponent />
  49.         </div>
  50.     );
  51. };
  52.  
  53. export default MediaList;
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement