import { Tabs } from 'antd'; import { useRecoilValue } from 'recoil'; import { FC } from 'react'; import { IndieAuthModal } from '../IndieAuthModal/IndieAuthModal'; import { FediAuthModal } from '../FediAuthModal/FediAuthModal'; import styles from './AuthModal.module.scss'; import { currentUserAtom, chatAuthenticatedAtom, accessTokenAtom, clientConfigStateAtom, } from '../../stores/ClientConfigStore'; import { ClientConfig } from '../../../interfaces/client-config.model'; export type AuthModalProps = { forceTabs?: boolean; }; export const AuthModal: FC = ({ forceTabs }) => { const authenticated = useRecoilValue(chatAuthenticatedAtom); const accessToken = useRecoilValue(accessTokenAtom); const currentUser = useRecoilValue(currentUserAtom); const clientConfig = useRecoilValue(clientConfigStateAtom); if (!currentUser) { return null; } const { displayName } = currentUser; const { federation } = clientConfig; const { enabled: fediverseEnabled } = federation; const indieAuthTabTitle = ( IndieAuth IndieAuth ); const indieAuthTab = ( ); const fediAuthTabTitle = ( Fediverse auth FediAuth ); const fediAuthTab = ( ); const items = [ { label: indieAuthTabTitle, key: '1', children: indieAuthTab }, { label: fediAuthTabTitle, key: '2', children: fediAuthTab }, ]; return (
null} />
); };