update buy handler

This commit is contained in:
Ayush Acharjya
2024-10-26 18:15:55 +01:00
parent dc7a44551b
commit 02893578f9
11 changed files with 995 additions and 112 deletions

View File

@@ -1,4 +1,3 @@
'use client';
import React from 'react';
import {
Card,
@@ -11,8 +10,15 @@ import { Badge } from '@/components/ui/badge';
import { Separator } from '@/components/ui/separator';
import ImageCarousel from './ImageCarousel';
import TicketButton from './TicketButton';
import { buyHandler } from '@/lib/buyHandler';
import { useToast } from '@/hooks/use-toast';
const EventDescription = ({ eventId }: { eventId: string }) => {
const { toast } = useToast();
const handleBuyNow = () => {
buyHandler(Number(eventId), toast);
};
const EventDescription = () => {
return (
<Card className="pt-10 pb-16 px-6 bg-gradient-to-r from-blue-50 to-gray-50 rounded-xl shadow-lg max-w-4xl mx-auto">
<CardHeader className="flex flex-col items-start space-y-4">
@@ -47,6 +53,7 @@ const EventDescription = () => {
<Button
variant="default"
className="w-full md:w-auto bg-gradient-to-r from-blue-500 to-purple-600 text-white font-semibold rounded-lg hover:from-blue-600 hover:to-purple-700"
onClick={handleBuyNow}
>
Buy now Using MetaMask
</Button>