grafana/public/app/features/explore/NoDataSourceCallToAction.tsx
Olof Bourghardt 0bbfe3f7b4
Explore: use GrafanaTheme2 (NoDataSourceCallToAction component) (#37542)
* Explore: use GrafanaTheme2 in NoDataSourceCallToAction component

* Explore: add px to the end of styling
2021-08-05 13:30:31 +02:00

41 lines
1.1 KiB
TypeScript

import React from 'react';
import { css } from '@emotion/css';
import { LinkButton, CallToActionCard, Icon, useTheme2 } from '@grafana/ui';
export const NoDataSourceCallToAction = () => {
const theme = useTheme2();
const message =
'Explore requires at least one data source. Once you have added a data source, you can query it here.';
const footer = (
<>
<Icon name="rocket" />
<> ProTip: You can also define data sources through configuration files. </>
<a
href="http://docs.grafana.org/administration/provisioning/#datasources?utm_source=explore"
target="_blank"
rel="noreferrer"
className="text-link"
>
Learn more
</a>
</>
);
const ctaElement = (
<LinkButton size="lg" href="datasources/new" icon="database">
Add data source
</LinkButton>
);
const cardClassName = css`
max-width: ${theme.breakpoints.values.lg}px;
margin-top: ${theme.spacing(2)};
align-self: center;
`;
return (
<CallToActionCard callToActionElement={ctaElement} className={cardClassName} footer={footer} message={message} />
);
};