import Link from "next/link"; import { Fragment } from "react"; import { availabilityAsString } from "@calcom/lib/availability"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Availability } from "@calcom/prisma/client"; import { inferQueryOutput } from "@calcom/trpc/react"; import Dropdown, { DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@calcom/ui/Dropdown"; import { Icon } from "@calcom/ui/Icon"; import Badge from "@calcom/ui/v2/core/Badge"; import Button from "@calcom/ui/v2/core/Button"; export function ScheduleListItem({ schedule, deleteFunction, isDeleting = false, displayOptions, }: { schedule: inferQueryOutput<"viewer.availability.list">["schedules"][number]; deleteFunction: ({ scheduleId }: { scheduleId: number }) => void; isDeleting: boolean; displayOptions?: { timeZone?: string; hour12?: boolean; }; }) { const { t, i18n } = useLocale(); return (
  • {schedule.name} {schedule.isDefault && ( {t("default")} )}

    {schedule.availability.map((availability: Availability) => ( {availabilityAsString(availability, { locale: i18n.language, hour12: displayOptions?.hour12, })}
    ))} {schedule.timeZone && schedule.timeZone !== displayOptions?.timeZone && (

     {schedule.timeZone}

    )}

  • ); }