2
2
import { useAsyncData } from ' #imports'
3
3
import { type AdminPage , type Role , selectableRoleList } from ' @vuejs-jp/model'
4
4
import { match } from ' ts-pattern'
5
- import { ref , watch } from ' vue'
5
+ import { computed , ref , watch } from ' vue'
6
6
import { useCsv } from ' @vuejs-jp/composable'
7
7
import { useSupabase } from ' ~/composables/useSupabase'
8
8
import { useSupabaseCsv } from ' ~/composables/useSupabaseCsv'
@@ -40,6 +40,16 @@ const props = defineProps<ListProps>()
40
40
const showDialog = ref (false )
41
41
const handleDialog = () => showDialog .value = ! showDialog .value
42
42
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
+
43
53
watch (
44
54
() => selectedRole .value ,
45
55
() => refreshAttendee (),
@@ -66,7 +76,7 @@ const pageText = props.page.replace(/^[a-z]/g, function (val) {
66
76
<template >
67
77
<div class =" tab-content" >
68
78
<div class =" tab-content-header" >
69
- <h2 >{{ pageText }}</h2 >
79
+ <h2 >{{ `${ pageText} (${page === 'namecard' ? '照合完了計: ' : '計: '}${count}件)` }}</h2 >
70
80
<div >
71
81
<VFLinkButton
72
82
is =" button"
0 commit comments