import {useFormContext} from 'react-hook-form';
import {SettingsPanel} from '@common/admin/settings/settings-panel';
import {FormSwitch} from '@common/ui/forms/toggle/switch';
import {AdminSettings} from '@common/admin/settings/admin-settings';
import {FormTextField} from '@common/ui/forms/input-field/text-field/text-field';
import {SettingsErrorGroup} from '@common/admin/settings/settings-error-group';
import {Trans} from '@common/i18n/trans';
import {Fragment} from 'react';
import {Link} from 'react-router-dom';
import {useSettings} from '@common/core/settings/use-settings';
import {SettingsSeparator} from '@common/admin/settings/settings-separator';
export function AuthenticationSettings() {
return (
}
description={
}
>
}
>
}
>
}
>
}
description={
}
/>
);
}
function EmailConfirmationSection() {
const {watch} = useFormContext();
const mailSetup = watch('server.mail_setup');
return (
{!mailSetup && (
(
{text}
),
}}
/>
)}
}
>
);
}
function EnvatoSection() {
const {watch} = useFormContext();
const settings = useSettings();
const envatoLoginEnabled = watch('client.social.envato.enable');
if (!(settings as any).envato?.enable) return null;
return (
{isInvalid => (
<>
}
>
{!!envatoLoginEnabled && (
<>
}
required
/>
}
required
/>
}
required
/>
>
)}
>
)}
);
}
function GoogleSection() {
const {watch} = useFormContext();
const googleLoginEnabled = watch('client.social.google.enable');
return (
{isInvalid => (
<>
}
>
{!!googleLoginEnabled && (
<>
}
required
/>
}
required
/>
>
)}
>
)}
);
}
function FacebookSection() {
const {watch} = useFormContext();
const facebookLoginEnabled = watch('client.social.facebook.enable');
return (
{isInvalid => (
<>
}
>
{!!facebookLoginEnabled && (
<>
}
required
/>
}
required
/>
>
)}
>
)}
);
}
function TwitterSection() {
const {watch} = useFormContext();
const twitterLoginEnabled = watch('client.social.twitter.enable');
return (
{isInvalid => (
<>
}
>
{!!twitterLoginEnabled && (
<>
}
required
/>
}
required
/>
>
)}
>
)}
);
}