| 12345678910111213141516171819202122232425262728293031323334353637 |
- import clsx from "clsx";
- import Link from "next/link";
- import type { ElementType } from "react";
- interface NovelCoverProps {
- component?: ElementType;
- className?: string;
- href?: string;
- title?: string;
- alt?: string;
- src?: string;
- }
- export default function NovelCover(props: NovelCoverProps) {
- let {
- component: Component = Link,
- className,
- alt = "",
- src = "",
- ...other
- } = props;
- if (!other.href) {
- Component = "div";
- }
- return (
- <Component className={clsx("novel-cover", className)} {...other}>
- <img
- src={src}
- alt={alt || other.title || ""}
- draggable="false"
- loading="lazy"
- />
- </Component>
- );
- }
|