mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
refactor: update frontmatter type and change React to Astro
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
import Datetime from "./Datetime";
|
||||
import type { Frontmatter } from "src/types";
|
||||
|
||||
export interface Props {
|
||||
href?: string;
|
||||
post: Frontmatter;
|
||||
secHeading?: boolean;
|
||||
}
|
||||
|
||||
const styles = {
|
||||
cardContainer: "my-6",
|
||||
titleLink:
|
||||
"text-skin-accent font-medium text-lg underline-offset-4 decoration-dashed focus-visible:no-underline focus-visible:underline-offset-0 inline-block",
|
||||
titleHeading: "font-medium text-lg decoration-dashed hover:underline",
|
||||
};
|
||||
|
||||
export default function Card({ href, post, secHeading = true }: Props) {
|
||||
return (
|
||||
<li className={styles.cardContainer}>
|
||||
<a href={href} className={styles.titleLink}>
|
||||
{secHeading ? (
|
||||
<h2 className={styles.titleHeading}>{post.title}</h2>
|
||||
) : (
|
||||
<h3 className={styles.titleHeading}>{post.title}</h3>
|
||||
)}
|
||||
</a>
|
||||
<Datetime datetime={post.datetime} />
|
||||
<p>{post.description}</p>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user