* refactor: move feature-flags, calendars, and schedules components from packages/features to apps/web/modules Co-Authored-By: benny@cal.com <sldisek783@gmail.com> * fix * fix * fix * fix: move DatePicker and DateOverrideInputDialog to apps/web/modules and update imports Co-Authored-By: benny@cal.com <sldisek783@gmail.com> * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * rename * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * wip * wip * wip * fix unit tests --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
import DestinationCalendarSelector from "@calcom/features/calendars/components/DestinationCalendarSelector";
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|
import type { RouterInputs } from "@calcom/trpc/react";
|
|
import { trpc } from "@calcom/trpc/react";
|
|
|
|
interface ICreateEventsOnCalendarSelectProps {
|
|
calendar?: RouterInputs["viewer"]["calendars"]["setDestinationCalendar"] | null;
|
|
}
|
|
|
|
const CreateEventsOnCalendarSelect = (props: ICreateEventsOnCalendarSelectProps) => {
|
|
const { calendar } = props;
|
|
const { t } = useLocale();
|
|
const mutation = trpc.viewer.calendars.setDestinationCalendar.useMutation();
|
|
const connectedCalendarsQuery = trpc.viewer.calendars.connectedCalendars.useQuery();
|
|
|
|
return (
|
|
<>
|
|
<div className="mt-6 flex flex-row">
|
|
<div className="w-full">
|
|
<label htmlFor="createEventsOn" className="text-default flex text-sm font-medium">
|
|
{t("create_events_on")}
|
|
</label>
|
|
<div className="mt-2">
|
|
<DestinationCalendarSelector
|
|
value={calendar ? calendar.externalId : undefined}
|
|
onChange={(calendar) => {
|
|
mutation.mutate(calendar);
|
|
}}
|
|
hidePlaceholder
|
|
calendarsQueryData={connectedCalendarsQuery.data}
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export { CreateEventsOnCalendarSelect };
|