mini-pic.tsx 1000 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { useTheme } from "next-themes";
  2. import { Image } from "@heroui/react";
  3. interface MiniPicProps {
  4. onClick?: () => void;
  5. showOverlay?: boolean;
  6. }
  7. const MiniPic = ({ onClick, showOverlay = false }: MiniPicProps) => {
  8. const { theme } = useTheme();
  9. const isDark = theme === "dark";
  10. return (
  11. <div className="relative w-full h-full cursor-pointer" onClick={onClick}>
  12. {isDark ? (
  13. <Image
  14. alt="cover"
  15. className="rounded-b-none object-cover"
  16. src="mini-dark.jpg"
  17. />
  18. ) : (
  19. <Image
  20. alt="cover"
  21. className="rounded-b-none object-cover"
  22. src="mini-light.jpg"
  23. />
  24. )}
  25. {showOverlay && (
  26. <div className="absolute inset-0 flex items-end justify-center pb-4 z-10">
  27. <span className="bg-black/50 text-white text-xs px-3 py-1.5 rounded-full backdrop-blur-sm">
  28. Click for 3D
  29. </span>
  30. </div>
  31. )}
  32. </div>
  33. );
  34. };
  35. export default MiniPic;