/* eslint-disable */ // @ts-nocheck import { FormGroup, Switch } from "../../../shared/@patternfly/react-core"; import { Controller, FormProvider, UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { HelpItem, TextControl } from "../../../shared/keycloak-ui-shared"; import { FormAccess } from "../../components/form/FormAccess"; import { WizardSectionHeader } from "../../components/wizard-section-header/WizardSectionHeader"; export type LdapSettingsSynchronizationProps = { form: UseFormReturn; showSectionHeading?: boolean; showSectionDescription?: boolean; }; export const LdapSettingsSynchronization = ({ form, showSectionHeading = false, showSectionDescription = false, }: LdapSettingsSynchronizationProps) => { const { t } = useTranslation(); const watchPeriodicSync = form.watch("config.periodicFullSync", false); const watchChangedSync = form.watch("config.periodicChangedUsersSync", false); return ( {showSectionHeading && ( )} } fieldId="kc-import-users" > ( field.onChange([`${value}`])} isChecked={field.value[0] === "true"} isDisabled={false} aria-label={t("importUsers")} /> )} > } fieldId="syncRegistrations" > ( field.onChange([`${value}`])} isChecked={field.value[0] === "true"} aria-label={t("syncRegistrations")} /> )} /> } fieldId="kc-periodic-full-sync" hasNoPaddingTop > ( field.onChange(value)} isChecked={field.value === true} label={t("on")} labelOff={t("off")} aria-label={t("periodicFullSync")} /> )} /> {watchPeriodicSync && ( )} } fieldId="kc-periodic-changed-users-sync" hasNoPaddingTop > ( field.onChange(value)} isChecked={field.value === true} label={t("on")} labelOff={t("off")} aria-label={t("periodicChangedUsersSync")} /> )} /> {watchChangedSync && ( )} } fieldId="kc-remove-invalid-users" hasNoPaddingTop > ( field.onChange([`${value}`])} isChecked={field.value[0] === "true"} label={t("on")} labelOff={t("off")} aria-label={t("removeInvalidUsers")} /> )} /> ); };