mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 19:41:02 +08:00
Add react Card component
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
import Datetime from "./Datetime";
|
||||||
|
import type { Frontmatter } from "@utils/types";
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
href?: string;
|
||||||
|
post: Frontmatter;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Card({ href, post }: Props) {
|
||||||
|
return (
|
||||||
|
<li className="my-6">
|
||||||
|
<a
|
||||||
|
href={href}
|
||||||
|
className="text-skin-accent font-medium text-lg underline-offset-4 decoration-dashed focus-visible:underline"
|
||||||
|
>
|
||||||
|
<h2 className="font-medium text-lg decoration-dashed hover:underline">
|
||||||
|
{post.title}
|
||||||
|
</h2>
|
||||||
|
</a>
|
||||||
|
<Datetime datetime={post.datetime} />
|
||||||
|
<p>{post.description}</p>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user