Files
caszl-next/app/components/ArticleRender.tsx

35 lines
1.1 KiB
TypeScript
Raw Normal View History

2023-10-27 17:29:50 +08:00
import { ArticleDetail } from "@/app/types/article";
2023-10-30 17:29:35 +08:00
import Link from "next/link";
2023-11-01 17:27:06 +08:00
import ArticleHeading from "@/app/components/ArticleHeading";
2023-10-27 17:29:50 +08:00
2023-11-01 17:27:06 +08:00
const ArticleRender = ({ article }: { article: ArticleDetail }) => {
2023-10-27 17:29:50 +08:00
return (
2023-10-30 17:29:35 +08:00
<div className={"h-full"}>
2023-11-01 17:27:06 +08:00
<ArticleHeading text={article.title} />
2023-10-27 17:29:50 +08:00
<div dangerouslySetInnerHTML={{ __html: article.content }}></div>
2023-11-03 17:25:10 +08:00
<div className={"bottom-nav mb-[50px] mt-[27px]"}>
2023-10-30 17:29:35 +08:00
<div className={"prev"}>
<span className={"text-base"}></span>
<Link
2023-11-03 17:25:10 +08:00
className={"ml-8 text-sm text-[#666]"}
2023-10-30 17:29:35 +08:00
href={`./${article.prev?.id}`}
>
{article.prev?.title ?? "没有了"}
</Link>
</div>
<div className={"next mt-8"}>
<span className={"text-base"}></span>
<Link
2023-11-03 17:25:10 +08:00
className={"ml-8 text-sm text-[#666]"}
2023-10-30 17:29:35 +08:00
href={`./${article.next?.id}`}
>
{article.next?.title ?? "没有了"}
</Link>
</div>
</div>
2023-10-27 17:29:50 +08:00
</div>
);
};
2023-11-01 17:27:06 +08:00
export default ArticleRender;