feat: Format event price and wallet balance in PurchaseTicketDialog and events page

- Implemented formatting functions for event ticket prices and wallet balances to enhance readability and user experience.
- Updated PurchaseTicketDialog.vue and events.vue to utilize the new formatting functions, ensuring consistent display of financial information.
This commit is contained in:
padreug 2025-08-10 17:56:20 +02:00
parent 147cf31f0f
commit df7e461c91
4 changed files with 287 additions and 4 deletions

View file

@ -11,6 +11,7 @@ import { Badge } from '@/components/ui/badge'
import { format } from 'date-fns'
import PurchaseTicketDialog from '@/components/events/PurchaseTicketDialog.vue'
import { RefreshCw, User, LogIn } from 'lucide-vue-next'
import { formatEventPrice } from '@/lib/utils/formatting'
const { upcomingEvents, pastEvents, isLoading, error, refresh } = useEvents()
const { isAuthenticated, userDisplay } = useAuth()
@ -99,7 +100,7 @@ function handlePurchaseClick(event: {
</div>
<div class="flex justify-between">
<span class="text-muted-foreground">Price:</span>
<span class="text-foreground">{{ event.price_per_ticket }} {{ event.currency }}</span>
<span class="text-foreground">{{ formatEventPrice(event.price_per_ticket, event.currency) }}</span>
</div>
</div>
</CardContent>