-
- {t("Enforce two-factor authentication")}
-
- {t(
- "Once enforced, all members must enable two-factor authentication to access the workspace.",
- )}
-
-
+
+
+ {t("Enforce two-factor authentication")}
+
+ {t(
+ "Once enforced, all members must enable two-factor authentication to access the workspace.",
+ )}
+
+
-
-
- >
+
+
);
}
diff --git a/apps/client/src/ee/security/components/space-public-sharing-toggle.tsx b/apps/client/src/ee/security/components/space-public-sharing-toggle.tsx
new file mode 100644
index 00000000..f03d18f2
--- /dev/null
+++ b/apps/client/src/ee/security/components/space-public-sharing-toggle.tsx
@@ -0,0 +1,84 @@
+import { Group, Text, Switch, Tooltip } from "@mantine/core";
+import { modals } from "@mantine/modals";
+import { useAtom } from "jotai";
+import { workspaceAtom } from "@/features/user/atoms/current-user-atom.ts";
+import React, { useState } from "react";
+import { useTranslation } from "react-i18next";
+import { ISpace } from "@/features/space/types/space.types.ts";
+import { useUpdateSpaceMutation } from "@/features/space/queries/space-query.ts";
+
+type SpacePublicSharingToggleProps = {
+ space: ISpace;
+};
+
+export default function SpacePublicSharingToggle({
+ space,
+}: SpacePublicSharingToggleProps) {
+ const { t } = useTranslation();
+ const [workspace] = useAtom(workspaceAtom);
+ const workspaceDisabled = workspace?.settings?.sharing?.disabled === true;
+ const [checked, setChecked] = useState(
+ space.settings?.sharing?.disabled === true,
+ );
+ const updateSpaceMutation = useUpdateSpaceMutation();
+
+ const applyChange = async (value: boolean) => {
+ try {
+ await updateSpaceMutation.mutateAsync({
+ spaceId: space.id,
+ disablePublicSharing: value,
+ });
+ setChecked(value);
+ } catch {
+ // error handled by mutation
+ }
+ };
+
+ const handleChange = (event: React.ChangeEvent