yufan.me/src/components/like/LikeIcon.astro

20 lines
473 B
Plaintext
Raw Normal View History

2024-06-14 02:11:26 +08:00
---
import { queryLikesAndViews } from '@/helpers/db/query';
interface Props {
permalink: string;
2024-06-14 02:11:26 +08:00
}
const { permalink } = Astro.props;
const [likes, view] = await queryLikesAndViews(permalink);
2024-06-14 02:11:26 +08:00
---
<div class="list-like d-inline-block">
<i class="text-md iconfont icon-eye"></i>
<span class="like-count">{view}</span>
</div>
<div class="list-like d-inline-block">
<i class="text-md iconfont icon-heart-fill"></i>
<span class="like-count">{likes}</span>
</div>