2022-12-17 21:35:07 +00:00
|
|
|
<script setup lang="ts">
|
2023-01-04 20:08:05 +00:00
|
|
|
import type { History, Tag } from 'masto'
|
|
|
|
|
|
|
|
const { hashtag } = defineProps<{ hashtag: Tag }>()
|
|
|
|
|
|
|
|
const totalTrend = $computed(() =>
|
|
|
|
hashtag.history?.reduce((total: number, item) => total + (Number(item.accounts) || 0), 0),
|
|
|
|
)
|
2022-12-17 21:35:07 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div flex flex-row items-center gap2>
|
|
|
|
<div w-12 h-12 rounded-full bg-active flex place-items-center place-content-center>
|
|
|
|
<div i-ri:hashtag text-secondary text-lg />
|
|
|
|
</div>
|
|
|
|
<div flex flex-col>
|
|
|
|
<span>
|
|
|
|
{{ hashtag.name }}
|
|
|
|
</span>
|
2023-01-04 20:08:05 +00:00
|
|
|
<CommonTrending :history="hashtag.history" text-xs text-secondary truncate />
|
|
|
|
</div>
|
|
|
|
<div v-if="totalTrend" w-12 h-12 flex place-items-center place-content-center ml-auto>
|
|
|
|
<CommonTrendingCharts :history="hashtag.history" text-xs text-secondary />
|
2022-12-17 21:35:07 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|