yufan.me/src/components/like/LikeIcon.astro
Yufan Sheng 6a4d7243c9
feat: use action for better configuring the backend API. ()
* chore: bump the dependencies.

* feat: define the actions for all the rest requests.

* feat: use action to perform requests.
2024-11-15 14:53:52 +08:00

20 lines
473 B
Plaintext

---
import { queryLikesAndViews } from '@/helpers/db/query';
interface Props {
permalink: string;
}
const { permalink } = Astro.props;
const [likes, view] = await queryLikesAndViews(permalink);
---
<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>