mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* 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]>
32 lines
1.0 KiB
TypeScript
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>
|
|
);
|
|
};
|