mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 16:38:20 +01:00
45 lines
1.3 KiB
Vue
45 lines
1.3 KiB
Vue
<template>
|
|
<div class="flex flex-row w-full items-stretch justify-around text-sm *:max-w-28 *:w-full *:text-muted-foreground">
|
|
<Button variant="ghost">
|
|
<Reply class="size-5 text-primary" />
|
|
{{ numberFormat(replyCount) }}
|
|
</Button>
|
|
<Button variant="ghost">
|
|
<Heart class="size-5 text-primary" />
|
|
{{ numberFormat(likeCount) }}
|
|
</Button>
|
|
<Button variant="ghost">
|
|
<Repeat class="size-5 text-primary" />
|
|
{{ numberFormat(reblogCount) }}
|
|
</Button>
|
|
<Button variant="ghost">
|
|
<Quote class="size-5 text-primary" />
|
|
</Button>
|
|
<Menu>
|
|
<Button variant="ghost">
|
|
<Ellipsis class="size-5 text-primary" />
|
|
</Button>
|
|
</Menu>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { Ellipsis, Heart, Quote, Repeat, Reply } from "lucide-vue-next";
|
|
import { Button } from "~/components/ui/button";
|
|
import Menu from "./menu.vue";
|
|
|
|
defineProps<{
|
|
replyCount: number;
|
|
likeCount: number;
|
|
reblogCount: number;
|
|
}>();
|
|
|
|
const numberFormat = (number = 0) =>
|
|
number !== 0
|
|
? new Intl.NumberFormat(undefined, {
|
|
notation: "compact",
|
|
compactDisplay: "short",
|
|
maximumFractionDigits: 1,
|
|
}).format(number)
|
|
: undefined;
|
|
</script> |