import React, { FC } from 'react'; import { Card } from '../types'; import { Icon, stylesFactory, useTheme } from '@grafana/ui'; import { GrafanaTheme } from '@grafana/data'; import { css } from '@emotion/css'; import { cardContent, cardStyle, iconStyle } from './sharedStyles'; interface Props { card: Card; } export const DocsCard: FC = ({ card }) => { const theme = useTheme(); const styles = getStyles(theme, card.done); return (
{card.done ? 'complete' : card.heading}

{card.title}

Learn how in the docs
); }; const getStyles = stylesFactory((theme: GrafanaTheme, complete: boolean) => { return { card: css` ${cardStyle(theme, complete)} min-width: 230px; @media only screen and (max-width: ${theme.breakpoints.md}) { min-width: 192px; } `, heading: css` text-transform: uppercase; color: ${complete ? theme.palette.blue95 : '#FFB357'}; margin-bottom: ${theme.spacing.md}; `, title: css` margin-bottom: ${theme.spacing.md}; `, url: css` border-top: 1px solid ${theme.colors.border1}; position: absolute; bottom: 0; padding: 8px 16px; width: 100%; `, }; });