import * as React from 'react'; import I18n from 'i18n-js'; import { IOAuth } from '../../../interfaces/IOAuth'; import Switch from '../../common/Switch'; import Separator from '../../common/Separator'; import { AuthenticationPages } from './AuthenticationSiteSettingsP'; import CopyToClipboardButton from '../../common/CopyToClipboardButton'; interface Props { oAuth: IOAuth; handleToggleEnabledOAuth(id: number, enabled: boolean): void; handleDeleteOAuth(id: number): void; setPage: React.Dispatch>; setSelectedOAuth: React.Dispatch>; } const OAuthProviderItem = ({ oAuth, handleToggleEnabledOAuth, handleDeleteOAuth, setPage, setSelectedOAuth, }: Props) => (
  • {oAuth.name}
    handleToggleEnabledOAuth(oAuth.id, !oAuth.isEnabled)} checked={oAuth.isEnabled} htmlId={`oAuth${oAuth.name}EnabledSwitch`} />
    window.open(`/o_auths/${oAuth.id}/start?reason=test`, '', 'width=640, height=640') }> Test { setSelectedOAuth(oAuth.id); setPage('edit'); }}> { I18n.t('common.buttons.edit') } confirm(I18n.t('common.confirmation')) && handleDeleteOAuth(oAuth.id)}> { I18n.t('common.buttons.delete') }
  • ); export default OAuthProviderItem;