diff options
| author | real-zephex <[email protected]> | 2024-05-24 22:51:36 +0530 |
|---|---|---|
| committer | real-zephex <[email protected]> | 2024-05-24 22:51:36 +0530 |
| commit | 180c9577f8337991ca71470816333fe8430cd3ca (patch) | |
| tree | 82caa5a920443bcf0db3746c7ecacd968d4fc148 /src/app/kdrama/components/searchFormatter.jsx | |
| parent | style: minor improvements to the anime cards (diff) | |
| download | dramalama-180c9577f8337991ca71470816333fe8430cd3ca.tar.xz dramalama-180c9577f8337991ca71470816333fe8430cd3ca.zip | |
✨ feat(ui): 🎨 migrate from vanilla css to tailwind css, adopted next ui and restructured
Diffstat (limited to 'src/app/kdrama/components/searchFormatter.jsx')
| -rw-r--r-- | src/app/kdrama/components/searchFormatter.jsx | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/app/kdrama/components/searchFormatter.jsx b/src/app/kdrama/components/searchFormatter.jsx new file mode 100644 index 0000000..bac2549 --- /dev/null +++ b/src/app/kdrama/components/searchFormatter.jsx @@ -0,0 +1,46 @@ +import { Card, CardHeader, CardBody, Image, Link } from "@nextui-org/react"; +import NextImage from "next/image"; + +import styles from "../../page.module.css"; + +const SearchedDataFormatter = async (data) => { + return ( + <section + className={`flex items-center overflow-auto pb-2 ${styles.ScrollBarAdjuster}`} + > + {data && + data.results.length > 0 && + data.results.map((item, index) => ( + <Link + key={index} + href={`/kdrama/${encodeURIComponent(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={item.image} + width={185} + 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.title} + </h4> + </CardHeader> + </Card> + </Link> + ))} + </section> + ); +}; + +export default SearchedDataFormatter; |