Files
caszl-next/app/_components/ArticleRender.tsx
quantulr a8b1ad286d update
2023-11-06 17:27:50 +08:00

47 lines
1.4 KiB
TypeScript

import { ArticleDetail } from "@/app/_types/article";
import Link from "next/link";
import ArticleHeading from "@/app/_components/ArticleHeading";
const ArticleRender = ({ article }: { article: ArticleDetail }) => {
return (
<div className={"h-full"}>
<ArticleHeading text={article.title} />
<div dangerouslySetInnerHTML={{ __html: article.content }}></div>
<div className={"bottom-nav mb-[50px] mt-[27px]"}>
<div className={"prev"}>
<span className={"text-base"}></span>
{article.prev ? (
<Link
className={"ml-8 text-sm text-[#666]"}
href={`./${article.prev?.id}`}
>
{article.prev.title}
</Link>
) : (
<span className={"ml-8 cursor-not-allowed text-sm text-[#666]"}>
</span>
)}
</div>
<div className={"next mt-8"}>
<span className={"text-base"}></span>
{article.next ? (
<Link
className={"ml-8 text-sm text-[#666]"}
href={`./${article.next?.id}`}
>
{article.next.title}
</Link>
) : (
<span className={"ml-8 cursor-not-allowed text-sm text-[#666]"}>
</span>
)}
</div>
</div>
</div>
);
};
export default ArticleRender;