Files
calendar/packages/features/ee/dsync/page/team-dsync-view.tsx
T
352d68ae1c perf: Remove app-store reference from @calcom/ui (#20188)
* perf: Remove app-store reference from @calcom/ui

* Fixing types

* Fixed casing

* fix type check

* refactor

* fix

* fix

* fix

* fix

* fix

* fix

---------

Co-authored-by: hbjORbj <sldisek783@gmail.com>
2025-03-19 05:04:02 -03:00

61 lines
1.7 KiB
TypeScript

"use client";
import { useRouter } from "next/navigation";
import { useEffect } from "react";
import { SkeletonLoader } from "@calcom/features/apps/components/SkeletonLoader";
import { HOSTED_CAL_FEATURES } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import { showToast } from "@calcom/ui/components/toast";
import ConfigureDirectorySync from "../components/ConfigureDirectorySync";
// For Hosted Cal - Team view
const DirectorySync = () => {
const { t } = useLocale();
const router = useRouter();
const { data: currentOrg, isLoading, error } = trpc.viewer.organizations.listCurrent.useQuery();
useEffect(() => {
if (!HOSTED_CAL_FEATURES) {
router.push("/404");
}
}, [router]);
if (isLoading) {
return <SkeletonLoader />;
}
if (!currentOrg?.id) {
router.push("/404");
}
if (error) {
showToast(error.message, "error");
}
return (
<div className="bg-default w-full sm:mx-0 xl:mt-0">
{HOSTED_CAL_FEATURES && <ConfigureDirectorySync organizationId={currentOrg?.id || null} />}
{/* TODO add additional settings for dsync */}
{/* <SettingsToggle
toggleSwitchAtTheEnd={true}
title="Map groups to teams 1:1"
description="Members will be auto assigned to teams with the same name as their group."
switchContainerClassName="mt-6"
/>
<SettingsToggle
toggleSwitchAtTheEnd={true}
title="Create new teams based on groups"
description="Automatically create new teams if a new group is pushed"
switchContainerClassName="mt-6"
/>
<Button>Default team config</Button> */}
</div>
);
};
export default DirectorySync;