{props.user.name}
{props.eventType.title}
{props.eventType.description}
import Head from 'next/head'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { ClockIcon, CalendarIcon } from '@heroicons/react/solid'; import prisma from '../../lib/prisma'; const dayjs = require('dayjs'); export default function Book(props) { const router = useRouter(); const { date, user } = router.query; const bookingHandler = event => { event.preventDefault(); const res = fetch( '/api/book/' + user, { body: JSON.stringify({ start: dayjs(date).format(), end: dayjs(date).add(props.eventType.length, 'minute').format(), name: event.target.name.value, email: event.target.email.value, notes: event.target.notes.value }), headers: { 'Content-Type': 'application/json' }, method: 'POST' } ); router.push("/success?date=" + date + "&type=" + props.eventType.id + "&user=" + props.user.username); } return (
{props.eventType.description}