Files
calendar/packages/platform/atoms/destination-calendar/wrappers/DestinationCalendarSettingsWebWrapper.tsx
e86ad03cde perf: Slim down logged in round 2 (#20535)
* perf: Slim down loggedInViewer some more

* Move locationOptions to apps router

* Moved calVideo related handlers to separate router

* Moved calendar related handlers to separate router

* Rename

* Moved deleteCredential to new router

* Moved updateProfile to me router

* fix unit test

* fix e2e test

* tweak

* missing

---------

Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: unknown <[email protected]>
2025-04-04 15:33:14 -04:00

32 lines
1.0 KiB
TypeScript

import { trpc } from "@calcom/trpc/react";
import { AtomsWrapper } from "../../src/components/atoms-wrapper";
import { DestinationCalendarSettings } from "../DestinationCalendar";
export const DestinationCalendarSettingsWebWrapper = () => {
const calendars = trpc.viewer.calendars.connectedCalendars.useQuery();
const utils = trpc.useUtils();
const mutation = trpc.viewer.calendars.setDestinationCalendar.useMutation({
onSuccess: () => {
utils.viewer.calendars.connectedCalendars.invalidate();
},
});
if (!calendars.data?.connectedCalendars || calendars.data.connectedCalendars.length < 1) {
return null;
}
return (
<AtomsWrapper>
<DestinationCalendarSettings
connectedCalendars={calendars.data.connectedCalendars}
isPending={mutation.isPending}
destinationCalendar={calendars.data.destinationCalendar}
value={calendars.data.destinationCalendar.externalId}
hidePlaceholder
onChange={mutation.mutate}
/>
</AtomsWrapper>
);
};