import Head from 'next/head'; import prisma from '../../lib/prisma'; import {useRouter} from 'next/router'; import dayjs from 'dayjs'; import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'; import isBetween from 'dayjs/plugin/isBetween'; import utc from 'dayjs/plugin/utc'; import timezone from 'dayjs/plugin/timezone'; import {CheckIcon} from "@heroicons/react/outline"; dayjs.extend(isSameOrBefore); dayjs.extend(isBetween); dayjs.extend(utc); dayjs.extend(timezone); export default function Type(props) { // Get router variables const router = useRouter(); return (
Cancelled {props.title} | {props.user.name || props.user.username} | Calendso
); } export async function getServerSideProps(context) { const user = await prisma.user.findFirst({ where: { username: context.query.user, }, select: { username: true, name: true, bio: true, avatar: true, eventTypes: true } }); return { props: { user, title: context.query.title }, } }