chore: import type

fix/organizer-location
Udit Takkar 2023-10-26 01:29:39 +05:30
parent a7b01a3e0d
commit c040851f9f
1 changed files with 6 additions and 2 deletions

View File

@ -3,6 +3,7 @@ import type { TFunction } from "next-i18next";
import { Controller, useFormContext } from "react-hook-form";
import type { z } from "zod";
import { DefaultEventLocationTypeEnum } from "@calcom/app-store/locations";
import { classNames } from "@calcom/lib";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Label } from "@calcom/ui";
@ -313,14 +314,17 @@ export const ComponentForField = ({
}
const moreThanOneInPersonOptions = !!(
field.options.filter((field) => {
return field.value === "inPerson";
return field.value === DefaultEventLocationTypeEnum.InPerson;
}).length > 1
);
const options = field.options.map((field) => {
return {
...field,
value: field.value === "inPerson" && moreThanOneInPersonOptions ? field.label : field.value,
value:
field.value === DefaultEventLocationTypeEnum.InPerson && moreThanOneInPersonOptions
? field.label
: field.value,
};
});