mirror of
https://github.com/alexohneander/alexohneander-astro.git
synced 2025-07-04 17:21:51 +00:00
33 lines
955 B
TypeScript
33 lines
955 B
TypeScript
import Datetime from "./Datetime";
|
|
import type { BlogFrontmatter } from "@content/_schemas";
|
|
|
|
export interface Props {
|
|
href?: string;
|
|
frontmatter: BlogFrontmatter;
|
|
secHeading?: boolean;
|
|
}
|
|
|
|
export default function Card({ href, frontmatter, secHeading = true }: Props) {
|
|
const { title, pubDatetime, description } = frontmatter;
|
|
return (
|
|
<li className="my-6">
|
|
<a
|
|
href={href}
|
|
className="inline-block text-lg font-medium text-skin-accent decoration-dashed underline-offset-4 focus-visible:no-underline focus-visible:underline-offset-0"
|
|
>
|
|
{secHeading ? (
|
|
<h2 className="text-lg font-medium decoration-dashed hover:underline">
|
|
{title}
|
|
</h2>
|
|
) : (
|
|
<h3 className="text-lg font-medium decoration-dashed hover:underline">
|
|
{title}
|
|
</h3>
|
|
)}
|
|
</a>
|
|
<Datetime datetime={pubDatetime} />
|
|
<p>{description}</p>
|
|
</li>
|
|
);
|
|
}
|