import React from 'react'; import config from 'app/core/config'; const loginServices: () => LoginServices = () => ({ saml: { enabled: config.samlEnabled, name: 'SAML', className: 'github', icon: 'key', }, google: { enabled: config.oauth.google, name: 'Google', }, github: { enabled: config.oauth.github, name: 'GitHub', }, gitlab: { enabled: config.oauth.gitlab, name: 'GitLab', }, grafanacom: { enabled: config.oauth.grafana_com, name: 'Grafana.com', hrefName: 'grafana_com', icon: 'grafana_com', }, oauth: { enabled: config.oauth.generic_oauth, name: 'OAuth', icon: 'sign-in', hrefName: 'generic_oauth', }, }); export interface LoginService { enabled: boolean; name: string; hrefName?: string; icon?: string; className?: string; } export interface LoginServices { [key: string]: LoginService; } export const LoginServiceButtons = () => { const keyNames = Object.keys(loginServices()); const serviceElements = keyNames.map(key => { const service: LoginService = loginServices()[key]; return service.enabled ? ( Sign in with {service.name} ) : null; }); return