import { css } from '@emotion/css'; import React from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { Badge, Card, useStyles2, Icon, Tooltip } from '@grafana/ui'; import { BASE_PATH } from '../constants'; export const LOGO_SIZE = '48px'; type Props = { providerId: string; displayName: string; enabled: boolean; configFoundInIniFile?: boolean; configPath?: string; authType?: string; badges?: JSX.Element[]; }; export function ProviderCard({ providerId, displayName, enabled, configFoundInIniFile, configPath, authType, badges, }: Props) { const styles = useStyles2(getStyles); configPath = BASE_PATH + (configPath || providerId); return ( {displayName} {configFoundInIniFile && ( <> <> Configuration found in .ini file )}
{authType && } {enabled ? : }
); } export const getStyles = (theme: GrafanaTheme2) => { return { container: css` min-height: ${theme.spacing(16)}; display: flex; flex-direction: column; justify-content: space-between; padding: ${theme.spacing(2)}; `, header: css` display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: ${theme.spacing(2)}; `, footer: css` display: flex; justify-content: space-between; `, name: css` align-self: flex-start; font-size: ${theme.typography.h4.fontSize}; color: ${theme.colors.text.primary}; margin: 0; `, initext: css` font-size: ${theme.typography.bodySmall.fontSize}; color: ${theme.colors.text.secondary}; padding: ${theme.spacing(1)} 0; // Add some padding max-width: 90%; // Add a max-width to prevent text from stretching too wide `, }; };