import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import { Badge, Button, Switch } from "@calcom/ui";
import { TroubleshooterListItemContainer } from "./TroubleshooterListItemContainer";
const SELECTION_COLORS = ["#f97316", "#84cc16", "#06b6d4", "#8b5cf6", "#ec4899", "#f43f5e"];
interface CalendarToggleItemProps {
title: string;
subtitle: string;
colorDot?: string;
status: "connected" | "not_found";
calendars?: {
active?: boolean;
name?: string;
}[];
}
function CalendarToggleItem(props: CalendarToggleItemProps) {
const badgeStatus = props.status === "connected" ? "green" : "orange";
const badgeText = props.status === "connected" ? "Connected" : "Not found";
return (
{t("calendars_were_checking_for_conflicts")}
{hasConnectedCalendars && !isLoading ? ( <> {data.connectedCalendars.map((calendar) => { const foundPrimary = calendar.calendars?.find((item) => item.primary); // Will be used when getAvailbility is modified to use externalId instead of appId for source. // const color = SELECTION_COLORS[idx] || "#000000"; // // Add calendar to color map using externalId (what we use on the backend to determine source) // addToColorMap(foundPrimary?.externalId, color); return (