import type { TFunction } from "next-i18next"; import { getAppName } from "@calcom/app-store/utils"; import type { CalendarEvent } from "@calcom/types/Calendar"; import { Info } from "./Info"; import { LinkIcon } from "./LinkIcon"; export function LocationInfo(props: { calEvent: CalendarEvent; t: TFunction }) { const { t } = props; let providerName = props.calEvent.location && getAppName(props.calEvent.location); if (props.calEvent.location && props.calEvent.location.includes("integrations:")) { const location = props.calEvent.location.split(":")[1]; providerName = location[0].toUpperCase() + location.slice(1); } // If location its a url, probably we should be validating it with a custom library if (props.calEvent.location && /^https?:\/\//.test(props.calEvent.location)) { providerName = props.calEvent.location; } if (props.calEvent.videoCallData) { const meetingId = props.calEvent.videoCallData.id; const meetingPassword = props.calEvent.videoCallData.password; const meetingUrl = props.calEvent.videoCallData.url; return ( {providerName} ) : ( <>{t("something_went_wrong")} ) } extraInfo={ <> {meetingId && (
<> {t("meeting_id")}: {meetingId}
)} {meetingPassword && (
<> {t("meeting_password")}: {meetingPassword}
)} {meetingUrl && (
<> {t("meeting_url")}:{" "} {meetingUrl}
)} } /> ); } if (props.calEvent.additionalInformation?.hangoutLink) { const hangoutLink: string = props.calEvent.additionalInformation.hangoutLink; return ( Google } /> ); } return ( <>{t("meeting_url_provided_after_confirmed")}

) : null } /> ); }