* fix: replace filter implementations on /insights * add authorization for teamIds * replace all the implementations * provide eventTypeId * remove log * fix teamId for isAll * fix Download button * remove legacy implementations * clean up * nullish check * remove unusable filters * revert style * fix type error * fix e2e test * fix type error * fix type error * fix e2e * extract util method * fix type error * fix type error * fix type error --------- Co-authored-by: Benny Joo <sldisek783@gmail.com>
22 lines
665 B
TypeScript
22 lines
665 B
TypeScript
import { BookingStatus } from "@calcom/prisma/enums";
|
|
import { Badge, type BadgeProps } from "@calcom/ui";
|
|
|
|
import { bookingStatusToText } from "../lib/bookingStatusToText";
|
|
|
|
export function BookingStatusBadge({ bookingStatus }: { bookingStatus: BookingStatus | null }) {
|
|
let badgeVariant: BadgeProps["variant"] = "success";
|
|
|
|
if (!bookingStatus) return null;
|
|
|
|
switch (bookingStatus) {
|
|
case BookingStatus.REJECTED:
|
|
case BookingStatus.AWAITING_HOST:
|
|
case BookingStatus.PENDING:
|
|
case BookingStatus.CANCELLED:
|
|
badgeVariant = "warning";
|
|
break;
|
|
}
|
|
|
|
return <Badge variant={badgeVariant}>{bookingStatusToText(bookingStatus)}</Badge>;
|
|
}
|