import prisma from "@lib/prisma";
import { useSession } from "next-auth/client";
import Shell from "@components/Shell";
import { useRouter } from "next/router";
import dayjs from "dayjs";
import { Fragment } from "react";
// TODO: replace headlessui with radix-ui
import { Menu, Transition } from "@headlessui/react";
import { DotsHorizontalIcon } from "@heroicons/react/solid";
import classNames from "@lib/classNames";
import { ClockIcon, XIcon, CheckIcon, BanIcon } from "@heroicons/react/outline";
import Loader from "@components/Loader";
import { Button } from "@components/ui/Button";
import { getSession } from "@lib/auth";
import { BookingStatus, User } from "@prisma/client";
export default function Bookings({ bookings }) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [session, loading] = useSession();
const router = useRouter();
if (loading) {
return
{!booking.confirmed && !booking.rejected && (
Unconfirmed
)}
{booking.eventType?.team && {booking.eventType.team.name}: }
{booking.title}
{dayjs(booking.startTime).format("D MMMM YYYY")}:{" "}
{dayjs(booking.startTime).format("HH:mm")} -{" "}
{dayjs(booking.endTime).format("HH:mm")}
|
{dayjs(booking.startTime).format("D MMMM YYYY")}
{dayjs(booking.startTime).format("HH:mm")} -{" "}
{dayjs(booking.endTime).format("HH:mm")}
|
{!booking.confirmed && !booking.rejected && (
<>
Rejected
)}
|