website/src/components/microblog-item.astro
Juan Carlos Manzanero Domínguez a5e383ae0a remove debug component
2024-06-25 17:31:11 -06:00

32 lines
952 B
Plaintext

---
import { marked } from "marked";
import formatDate from "@/utils/format-date";
const props = Astro.props;
const content = marked.parse(props.content);
---
<article class="rounded-md border px-4 py-2">
<header class="mb-2">
<section class="flex items-center justify-between text-sm">
<span class="font-light">
{formatDate(new Date(props.published))}{" "}
</span>
<span class="text-sm font-thin">
{new Date(props.published).toLocaleTimeString()}
</span>
</section>
<section class="mt-1">
{
props &&
props.expand.tags &&
props?.expand.tags.map(
(tag: any) =>
tag && <span class="text-sm">#{tag.name} </span>,
)
}
</section>
</header>
<main set:html={content} />
</article>