2022-12-11 11:52:36 +01:00
|
|
|
<script lang="ts" setup>
|
2023-01-08 07:21:09 +01:00
|
|
|
import type { mastodon } from 'masto'
|
2022-12-11 11:52:36 +01:00
|
|
|
|
|
|
|
const {
|
|
|
|
history,
|
|
|
|
maxDay = 2,
|
|
|
|
} = $defineProps<{
|
2023-01-08 07:21:09 +01:00
|
|
|
history: mastodon.v1.TagHistory[]
|
2022-12-11 11:52:36 +01:00
|
|
|
maxDay?: number
|
|
|
|
}>()
|
|
|
|
|
|
|
|
const ongoingHot = $computed(() => history.slice(0, maxDay))
|
|
|
|
|
|
|
|
const people = $computed(() =>
|
|
|
|
ongoingHot.reduce((total: number, item) => total + (Number(item.accounts) || 0), 0),
|
|
|
|
)
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<p>
|
|
|
|
{{ $t('command.n-people-in-the-past-n-days', [people, maxDay]) }}
|
|
|
|
</p>
|
|
|
|
</template>
|