move to PostPreview.js component

This commit is contained in:
2022-07-09 09:45:49 +08:00
parent 04aabf4d84
commit 9735880cd2
2 changed files with 38 additions and 23 deletions

19
components/PostPreview.js Normal file
View File

@@ -0,0 +1,19 @@
import styles from "../styles/Home.module.css";
import Link from "next/link";
import ClickForMore from "./ClickForMore";
function PostPreview({ title, description, date, href }) {
return (
<Link href={href} passHref>
<section className={styles.postPreview}>
<h2>{title}</h2>
<p>{description}</p>
<small>发布于 {date}</small>
{" | "}
<ClickForMore />
</section>
</Link>
);
}
export default PostPreview;