You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.5 KiB

  1. import React, { FC } from "react";
  2. import { TaxonomyType } from "@/data/types";
  3. import convertNumbThousand from "@/utils/convertNumbThousand";
  4. import Link from "next/link";
  5. import Image from "next/image";
  6. export interface CardCategory5Props {
  7. className?: string;
  8. taxonomy: TaxonomyType;
  9. }
  10. const CardCategory5: FC<CardCategory5Props> = ({
  11. className = "",
  12. taxonomy,
  13. }) => {
  14. const { count, name, href = "/", thumbnail } = taxonomy;
  15. return (
  16. <Link
  17. href={href}
  18. className={`nc-CardCategory5 flex flex-col ${className}`}
  19. data-nc-id="CardCategory5"
  20. >
  21. <div
  22. className={`flex-shrink-0 relative w-full aspect-w-4 aspect-h-3 h-0 rounded-2xl overflow-hidden group`}
  23. >
  24. <Image
  25. fill
  26. alt=""
  27. src={thumbnail || ""}
  28. className="object-cover w-full h-full rounded-2xl"
  29. sizes="(max-width: 400px) 100vw, 400px"
  30. />
  31. <span className="opacity-0 group-hover:opacity-100 absolute inset-0 bg-black bg-opacity-10 transition-opacity"></span>
  32. </div>
  33. <div className="mt-4 px-3 truncate">
  34. <h2
  35. className={`text-base sm:text-lg text-neutral-900 dark:text-neutral-100 font-medium truncate`}
  36. >
  37. {name}
  38. </h2>
  39. <span
  40. className={`block mt-2 text-sm text-neutral-6000 dark:text-neutral-400`}
  41. >
  42. {convertNumbThousand(count)} properties
  43. </span>
  44. </div>
  45. </Link>
  46. );
  47. };
  48. export default CardCategory5;