fix microblog type
This commit is contained in:
parent
ec3bccb0de
commit
f7a9ad8242
@ -1,38 +1,34 @@
|
|||||||
---
|
---
|
||||||
import { marked } from "marked";
|
import { marked } from "marked";
|
||||||
import formatDate from "@/utils/format-date";
|
import formatDate from "@/utils/format-date";
|
||||||
import type { MicroblogsResponse, TagsResponse } from "@/utils/pocketbase";
|
import { Debug } from "astro:components";
|
||||||
|
|
||||||
type Props = MicroblogsResponse<unknown> & {
|
|
||||||
props: {
|
|
||||||
tags: TagsResponse[];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const props = Astro.props;
|
const props = Astro.props;
|
||||||
const content = marked.parse(props.content);
|
const content = marked.parse(props.content);
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<Debug answer={props} />
|
||||||
|
|
||||||
<article class="rounded-md border px-4 py-2">
|
<article class="rounded-md border px-4 py-2">
|
||||||
<header class="mb-2">
|
<header class="mb-2">
|
||||||
<div class="flex items-center justify-between text-sm">
|
<section class="flex items-center justify-between text-sm">
|
||||||
<span class="font-light">
|
<span class="font-light">
|
||||||
{formatDate(new Date(props.published))}{" "}
|
{formatDate(new Date(props.published))}{" "}
|
||||||
</span>
|
</span>
|
||||||
<span class="text-sm font-thin">
|
<span class="text-sm font-thin">
|
||||||
{new Date(props.published).toLocaleTimeString()}
|
{new Date(props.published).toLocaleTimeString()}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</section>
|
||||||
<div class="mt-1">
|
<section class="mt-1">
|
||||||
{
|
{
|
||||||
props &&
|
props &&
|
||||||
props.expand.tags &&
|
props.expand.tags &&
|
||||||
props.expand.tags.map(
|
props?.expand.tags.map(
|
||||||
(tag: any) =>
|
(tag: any) =>
|
||||||
tag && <span class="text-sm">#{tag.name} </span>,
|
tag && <span class="text-sm">#{tag.name} </span>,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
</div>
|
</section>
|
||||||
</header>
|
</header>
|
||||||
<main set:html={content} />
|
<main set:html={content} />
|
||||||
</article>
|
</article>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user