11<script setup lang="ts">
22import type { AllClubs } from ' @@/types/api/user/all_clubs'
3+ import { Button } from ' @/components/ui/button'
4+ import { dark } from ' @clerk/themes'
5+ import { Dialog , DialogContent } from ' @/components/ui/dialog'
36import type { MyRecords } from ' @@/types/api/cas/record/my'
47import { useUser } from ' vue-clerk'
58import { usePreferredDark } from ' @vueuse/core'
@@ -9,6 +12,9 @@ import {
912 Settings ,
1013 Clock ,
1114} from ' lucide-vue-next'
15+ import { UserProfile } from ' vue-clerk'
16+
17+ const isDark = usePreferredDark ()
1218
1319definePageMeta ({
1420 middleware: [' auth' ],
@@ -29,6 +35,9 @@ const stats = ref({
2935
3036const isLoading = ref (true )
3137
38+ // Add this with your other refs
39+ const isSettingsOpen = ref (false )
40+
3241// Fetch clubs data
3342const { data : clubs } = await useQuery <AllClubs >({
3443 queryKey: [' /api/user/all_clubs' ],
@@ -84,24 +93,40 @@ onMounted(() => {
8493 <Card >
8594 <CardHeader >
8695 <CardTitle class =" text-3xl" >
87- <div class =" flex items-center gap-4" >
88- <Avatar class =" h-16 w-16 rounded-lg" >
89- <AvatarImage v-if =" user" :src =" user.imageUrl" :alt =" user.firstName" />
90- <AvatarFallback class =" rounded-lg" >
91- {{ user?.firstName?.slice(0, 2) }}
92- </AvatarFallback >
93- </Avatar >
94- <div >
95- 👋 Hi, {{ user?.firstName }}!
96- <div class =" text-base font-normal text-muted-foreground" >
97- {{ user?.primaryEmailAddress }}
96+ <div class =" flex items-center justify-between w-full" >
97+ <div class =" flex items-center gap-4" >
98+ <Avatar class =" h-16 w-16 rounded-lg" >
99+ <AvatarImage v-if =" user" :src =" user.imageUrl" :alt =" user.firstName" />
100+ <AvatarFallback class =" rounded-lg" >
101+ {{ user?.firstName?.slice(0, 2) }}
102+ </AvatarFallback >
103+ </Avatar >
104+ <div >
105+ 👋🏻 Hi, {{ user?.firstName }}!
106+ <div class =" text-base font-normal text-muted-foreground" >
107+ {{ user?.primaryEmailAddress }}
108+ </div >
98109 </div >
99110 </div >
111+ <Button variant =" ghost" size =" icon" @click =" isSettingsOpen = true" >
112+ <Settings class =" h-5 w-5" />
113+ <span class =" sr-only" >Open settings</span >
114+ </Button >
100115 </div >
101116 </CardTitle >
102117 </CardHeader >
118+ <!-- Rest of your existing card content -->
103119 </Card >
104120
121+ <!-- Settings Dialog -->
122+ <Dialog :open =" isSettingsOpen" @update:open =" isSettingsOpen = false" >
123+ <DialogContent class =" sm:max-w-[880px] p-0" >
124+ <UserProfile
125+ :appearance =" { baseTheme: isDark ? dark : undefined }"
126+ />
127+ </DialogContent >
128+ </Dialog >
129+
105130 <div class =" grid gap-4 md:grid-cols-2" >
106131 <!-- Account Info Card -->
107132 <Card >
0 commit comments