2022-12-17 22:35:07 +01:00
|
|
|
<script setup lang="ts">
|
2023-01-06 19:50:31 +01:00
|
|
|
import type { Tag } from 'masto'
|
2023-01-04 21:08:05 +01:00
|
|
|
|
2023-01-07 15:21:48 +01:00
|
|
|
const { hashtag } = defineProps<{
|
|
|
|
hashtag: Tag
|
|
|
|
}>()
|
2023-01-04 21:08:05 +01:00
|
|
|
|
|
|
|
const totalTrend = $computed(() =>
|
|
|
|
hashtag.history?.reduce((total: number, item) => total + (Number(item.accounts) || 0), 0),
|
|
|
|
)
|
2022-12-17 22:35:07 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-01-05 23:50:14 +01:00
|
|
|
<div flex flex-row items-center gap2 relative>
|
|
|
|
<div w-10 h-10 flex-none rounded-full bg-active flex place-items-center place-content-center>
|
2022-12-17 22:35:07 +01:00
|
|
|
<div i-ri:hashtag text-secondary text-lg />
|
|
|
|
</div>
|
|
|
|
<div flex flex-col>
|
|
|
|
<span>
|
|
|
|
{{ hashtag.name }}
|
|
|
|
</span>
|
2023-01-04 21:08:05 +01:00
|
|
|
<CommonTrending :history="hashtag.history" text-xs text-secondary truncate />
|
|
|
|
</div>
|
2023-01-05 23:50:14 +01:00
|
|
|
<div v-if="totalTrend" absolute left-15 right-0 top-0 bottom-4 op35 flex place-items-center place-content-center ml-auto>
|
2023-01-07 15:52:58 +01:00
|
|
|
<CommonTrendingCharts
|
|
|
|
:history="hashtag.history" :width="150" :height="20"
|
|
|
|
text-xs text-secondary h-full w-full
|
|
|
|
/>
|
2022-12-17 22:35:07 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|