2022-10-10 17:00:09 +00:00
|
|
|
import Link from "next/link";
|
|
|
|
|
|
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|
|
|
import { trpc } from "@calcom/trpc/react";
|
2022-11-23 02:55:25 +00:00
|
|
|
import { Badge } from "@calcom/ui";
|
2022-10-10 17:00:09 +00:00
|
|
|
|
|
|
|
export default function UnconfirmedBookingBadge() {
|
|
|
|
const { t } = useLocale();
|
2022-11-10 23:40:01 +00:00
|
|
|
const { data: unconfirmedBookingCount } = trpc.viewer.bookingUnconfirmedCount.useQuery();
|
2022-10-10 17:00:09 +00:00
|
|
|
if (!unconfirmedBookingCount) return null;
|
|
|
|
else
|
|
|
|
return (
|
|
|
|
<Link href="/bookings/unconfirmed">
|
2022-12-05 12:12:14 +00:00
|
|
|
<>
|
|
|
|
<Badge
|
|
|
|
rounded
|
|
|
|
title={t("unconfirmed_bookings_tooltip")}
|
|
|
|
variant="orange"
|
|
|
|
className="cursor-pointer hover:bg-orange-800 hover:text-orange-100">
|
2022-10-10 17:00:09 +00:00
|
|
|
{unconfirmedBookingCount}
|
|
|
|
</Badge>
|
2022-12-05 12:12:14 +00:00
|
|
|
</>
|
2022-10-10 17:00:09 +00:00
|
|
|
</Link>
|
|
|
|
);
|
|
|
|
}
|