feat: add friend count to buttons on friend page
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
ci/woodpecker/pr/build-and-publish Pipeline was successful

This commit is contained in:
Twig 2025-07-12 19:14:18 +02:00
parent f5457f9965
commit b731228fb8
No known key found for this signature in database

View file

@ -3,9 +3,9 @@
<DirectMessagesSidebar />
<div :id="$style['page-content']">
<div :id="$style['navigation-bar']">
<Button text="All Friends" variant="neutral" :callback="() => updateFilter('all')" />
<Button text="Online" variant="neutral" :callback="() => updateFilter('online')" />
<Button text="Pending" variant="neutral" :callback="() => updateFilter('pending')" />
<Button :text="`All Friends ${friends?.length}`" variant="neutral" :callback="() => updateFilter('all')" />
<Button :text="`Online ${0}`" variant="neutral" :callback="() => updateFilter('online')" />
<Button :text="`Pending ${0}`" variant="neutral" :callback="() => updateFilter('pending')" />
<Button text="Add Friend" variant="normal" :callback="() => updateFilter('add')" />
</div>
@ -24,8 +24,12 @@ import Button from '~/components/UserInterface/Button.vue';
import AddFriend from '~/components/Me/AddFriend.vue';
import FriendsList from '~/components/Me/FriendsList.vue';
const { fetchFriends } = useApi();
let filter = ref("all");
const friends = await fetchFriends()
function updateFilter(newFilter: string) {
filter.value = newFilter;
}