diff options
| author | real-zephex <[email protected]> | 2024-05-25 16:58:02 +0530 |
|---|---|---|
| committer | real-zephex <[email protected]> | 2024-05-25 16:58:02 +0530 |
| commit | 2d0bcaeeeffef4e6ed6f445378b9729e70901f61 (patch) | |
| tree | 40f63b16c4e11551b45b2989728eb659af47c6e2 /src/app/movies/components/searchFormatter.jsx | |
| parent | ✅ fix(anime): fix continue watching functionality and minor tweaks (diff) | |
| download | dramalama-2d0bcaeeeffef4e6ed6f445378b9729e70901f61.tar.xz dramalama-2d0bcaeeeffef4e6ed6f445378b9729e70901f61.zip | |
🚀 refactor(movie): revamped movie section
Diffstat (limited to 'src/app/movies/components/searchFormatter.jsx')
| -rw-r--r-- | src/app/movies/components/searchFormatter.jsx | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/app/movies/components/searchFormatter.jsx b/src/app/movies/components/searchFormatter.jsx new file mode 100644 index 0000000..47b684f --- /dev/null +++ b/src/app/movies/components/searchFormatter.jsx @@ -0,0 +1,51 @@ +import { Card, CardHeader, CardBody, Image, Link } from "@nextui-org/react"; +import NextImage from "next/image"; + +import styles from "../../page.module.css"; + +const MovieSearchFormatter = async (data) => { + return ( + <section + className={`flex items-center overflow-auto pb-2 mb-2 ${styles.ScrollBarAdjuster}`} + > + {data && + data.results.map((item, index) => { + if (item.poster_path) { + return ( + <Link + key={index} + href={`/movies/${item.id}`} + aria-label="anime redirection links" + className="flex flex-col items-center mx-1 " + > + <Card className="overflow-hidden" isPressable> + <CardBody> + <Image + as={NextImage} + isBlurred + alt="Anime Poster" + src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=https://image.tmdb.org/t/p/original${item.poster_path}`} + width={190} + height={120} + shadow="lg" + className="h-64" + priority + /> + </CardBody> + <CardHeader> + <h4 + className={`antialiased text-small text-center uppercase w-44 overflow-hidden whitespace-nowrap text-ellipsis `} + > + {item.original_title} + </h4> + </CardHeader> + </Card> + </Link> + ); + } + })} + </section> + ); +}; + +export default MovieSearchFormatter; |