diff --git a/src/components/auth/ProfileDialog.vue b/src/components/auth/ProfileDialog.vue index 4c2bbc1..26f3640 100644 --- a/src/components/auth/ProfileDialog.vue +++ b/src/components/auth/ProfileDialog.vue @@ -4,7 +4,7 @@ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } f import { Button } from '@/components/ui/button' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' -import { User, LogOut, Settings, Key } from 'lucide-vue-next' +import { User, LogOut, Settings, Key, Wallet, ExternalLink } from 'lucide-vue-next' import { auth } from '@/composables/useAuth' import { toast } from 'vue-sonner' @@ -21,12 +21,26 @@ const emit = defineEmits() const userDisplay = computed(() => auth.userDisplay.value) +// Get the API base URL from environment variables +const apiBaseUrl = import.meta.env.VITE_API_BASE_URL || '' + function handleLogout() { auth.logout() toast.success('Logged out successfully') handleClose() } +function handleOpenWallet() { + if (!auth.currentUser.value?.id) { + toast.error('User ID not available') + return + } + + const walletUrl = `${apiBaseUrl}/wallet?usr=${auth.currentUser.value.id}` + window.open(walletUrl, '_blank') + toast.success('Opening wallet in new tab') +} + function handleClose() { emit('update:isOpen', false) } @@ -95,6 +109,12 @@ function handleClose() {
+ +