Skip to content

Commit 896696e

Browse files
committed
update count
1 parent 58b8db0 commit 896696e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

apps/web/app/components/admin/Page.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { useAsyncData } from '#imports'
33
import { type AdminPage, type Role, selectableRoleList } from '@vuejs-jp/model'
44
import { match } from 'ts-pattern'
5-
import { ref, watch } from 'vue'
5+
import { computed, ref, watch } from 'vue'
66
import { useCsv } from '@vuejs-jp/composable'
77
import { useSupabase } from '~/composables/useSupabase'
88
import { useSupabaseCsv } from '~/composables/useSupabaseCsv'
@@ -40,6 +40,16 @@ const props = defineProps<ListProps>()
4040
const showDialog = ref(false)
4141
const handleDialog = () => showDialog.value = !showDialog.value
4242
43+
const count = computed(() => {
44+
return match(props.page)
45+
.with('speaker', () => speakers.value?.data?.length)
46+
.with('sponsor', () => sponsors.value?.data?.length)
47+
.with('job', () => jobs.value?.data?.length)
48+
.with('adminUser', () => staffs.value?.data?.length)
49+
.with('namecard', () => attendees.value?.data?.filter(attendee => attendee.activated_at !== null).length)
50+
.exhaustive()
51+
})
52+
4353
watch(
4454
() => selectedRole.value,
4555
() => refreshAttendee(),
@@ -66,7 +76,7 @@ const pageText = props.page.replace(/^[a-z]/g, function (val) {
6676
<template>
6777
<div class="tab-content">
6878
<div class="tab-content-header">
69-
<h2>{{ pageText }}</h2>
79+
<h2>{{ `${pageText} (${page === 'namecard' ? '照合完了計: ' : '計: '}${count}件)` }}</h2>
7080
<div>
7181
<VFLinkButton
7282
is="button"

0 commit comments

Comments
 (0)