Migrate to typescript
This commit is contained in:
@ -6,8 +6,13 @@ import { getPermalink } from '~/utils/permalinks';
|
||||
import { findImage } from '~/utils/images';
|
||||
import { getFormattedDate } from '~/utils/utils';
|
||||
|
||||
const { post } = Astro.props;
|
||||
import type { Post } from '~/utils/posts';
|
||||
|
||||
export interface Props {
|
||||
post: Post;
|
||||
}
|
||||
|
||||
const { post } = Astro.props;
|
||||
const image = await findImage(post.image);
|
||||
---
|
||||
|
||||
@ -47,7 +52,7 @@ const image = await findImage(post.image);
|
||||
<footer class="mt-4">
|
||||
<div>
|
||||
<span class="text-gray-500 dark:text-slate-400">
|
||||
<time datetime={post.publishDate}>{getFormattedDate(post.publishDate)}</time> ~
|
||||
<time datetime={String(post.publishDate)}>{getFormattedDate(post.publishDate)}</time> ~
|
||||
{Math.ceil(post.readingTime)} min read
|
||||
</span>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user