index.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import clsx from "clsx";
  2. import type { ElementType } from "react";
  3. interface NovelItemProps {
  4. component?: ElementType;
  5. className?: string;
  6. }
  7. export default function NovelItem(props: NovelItemProps) {
  8. const { component: Component, className, ...other } = props;
  9. if (Component) {
  10. return (
  11. <Component className={clsx("novel-cover", className)} {...other}>
  12. <img
  13. src="https://www.wuxiaworld.com/cdn-cgi/image/fit=contain,quality=75,format=auto/https://cdn.wuxiaworld.com/images/covers/og.jpg?ver=362f12103bcf1ea3fc048174300b89a65643336b"
  14. alt="Minecraft"
  15. draggable="false"
  16. loading="lazy"
  17. />
  18. </Component>
  19. );
  20. }
  21. return (
  22. <a
  23. href="/minecraft"
  24. title="Minecraft"
  25. className={clsx("novel-cover", className)}
  26. {...other}
  27. >
  28. <img
  29. src="https://www.wuxiaworld.com/cdn-cgi/image/fit=contain,quality=75,format=auto/https://cdn.wuxiaworld.com/images/covers/og.jpg?ver=362f12103bcf1ea3fc048174300b89a65643336b"
  30. alt="Minecraft"
  31. draggable="false"
  32. loading="lazy"
  33. />
  34. </a>
  35. );
  36. }