From d85bc63a0f18b202049e983280c0a96ade80596f Mon Sep 17 00:00:00 2001 From: salviega Date: Sun, 24 Sep 2023 04:44:22 -0500 Subject: [PATCH] :sparkles: Was added DTO and Event interface --- src/components/events/GetTicketCard.tsx | 6 ++- src/functions/dto/index.ts | 17 +++++++++ src/models/event.model.ts | 29 ++++++++++++++ src/pages/events/[id]/index.tsx | 50 +++++++++++++++++-------- 4 files changed, 85 insertions(+), 17 deletions(-) create mode 100644 src/functions/dto/index.ts create mode 100644 src/models/event.model.ts diff --git a/src/components/events/GetTicketCard.tsx b/src/components/events/GetTicketCard.tsx index 90d3b56..015267c 100644 --- a/src/components/events/GetTicketCard.tsx +++ b/src/components/events/GetTicketCard.tsx @@ -1,14 +1,16 @@ import React from 'react' import { Flex, Button, Text, VStack } from '@chakra-ui/react' +import { Event } from '@/models/event.model' type Props = { + event: Event getTicket: () => Promise isBuyTicketLoading: boolean hasTicket: boolean } const GetTicketCard = (props: Props) => { - const { getTicket, isBuyTicketLoading, hasTicket } = props + const { event, getTicket, isBuyTicketLoading, hasTicket } = props return ( { fontWeight='semibold' color={'#00001C'} > - ¡GRATIS! + ¡GRATIS! {event.totalTickets - event.remainingTickets} {hasTicket ? (