import { CalendarIcon } from "@heroicons/react/outline"; import { useRouter } from "next/router"; import { QueryCell } from "@lib/QueryCell"; import { inferQueryInput, trpc } from "@lib/trpc"; import BookingsShell from "@components/BookingsShell"; import EmptyScreen from "@components/EmptyScreen"; import Shell from "@components/Shell"; import BookingListItem from "@components/booking/BookingListItem"; type BookingListingStatus = inferQueryInput<"viewer.bookings">["status"]; const descriptionByStatus: Record = { upcoming: "As soon as someone books a time with you it will show up here.", past: "Your past bookings will show up here.", cancelled: "Your cancelled bookings will show up here.", }; export default function Bookings() { const router = useRouter(); const status = router.query?.status as BookingListingStatus; const query = trpc.useQuery(["viewer.bookings", { status }]); return (
(
{data.map((booking) => ( ))}
)} empty={() => ( )} />
); }