2023-04-11 18:25:38 -04:00
|
|
|
<script lang="ts">
|
|
|
|
export default {
|
2023-07-20 13:57:01 -04:00
|
|
|
props: {
|
|
|
|
categoryData: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {}
|
2023-04-11 18:25:38 -04:00
|
|
|
}
|
2023-07-20 13:57:01 -04:00
|
|
|
},
|
|
|
|
setup(props) {
|
|
|
|
return {
|
|
|
|
category: props.categoryData
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
abbreviate(text: number) {
|
|
|
|
return Intl.NumberFormat('en-US', {
|
|
|
|
//@ts-ignore
|
|
|
|
notation: 'compact',
|
|
|
|
maximumFractionDigits: 1
|
|
|
|
}).format(text)
|
|
|
|
}
|
|
|
|
}
|
2023-04-11 18:25:38 -04:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-07-20 13:57:01 -04:00
|
|
|
<div class="bg-ctp-crust w-40 lg:w-[11rem] md:w-[13.5rem] rounded-lg">
|
2023-07-24 15:59:58 -04:00
|
|
|
<router-link :to="`/directory/game/${category.name}`">
|
2023-07-20 13:57:01 -04:00
|
|
|
<img :src="category.image" class="rounded-lg rounded-b-none w-full" />
|
|
|
|
</router-link>
|
2023-04-11 18:25:38 -04:00
|
|
|
|
2023-07-20 13:57:01 -04:00
|
|
|
<div class="p-2">
|
|
|
|
<div>
|
|
|
|
<p class="font-bold text-white text-xl sm:text-base md:text-xl">
|
|
|
|
{{ category.displayName }}
|
|
|
|
</p>
|
|
|
|
<p class="text-sm text-white">{{ abbreviate(category.viewers) }} viewers</p>
|
|
|
|
</div>
|
2023-04-11 18:25:38 -04:00
|
|
|
|
2023-07-20 13:57:01 -04:00
|
|
|
<ul class="h-8 overflow-hidden">
|
|
|
|
<li v-for="tag in category.tags" :key="tag" class="inline-flex">
|
|
|
|
<span
|
|
|
|
class="p-2.5 py-1.5 bg-ctp-surface0 rounded-md m-0.5 text-xs font-bold text-white"
|
|
|
|
>{{ tag }}</span
|
|
|
|
>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2023-04-11 18:25:38 -04:00
|
|
|
</div>
|
2023-07-20 13:57:01 -04:00
|
|
|
</div>
|
|
|
|
</template>
|