grafana/public/app/features/explore/NoDataSourceCallToAction.tsx
kay delaney 7985aa1e57
Performance/Webpack: Introduces more aggressive code-splitting and other perf improvements (#18544)
* Performance/Webpack: Introduces more aggressive code-splitting and other perf improvements
- Introduces dynamic imports for built-in plugins
- Uses dynamic imports for various packages (rst2html, brace)
- Introduces route-based dynamic imports
- Splits angular and moment into separate bundles
2019-09-03 09:29:02 +01:00

47 lines
1.2 KiB
TypeScript

import React, { useContext } from 'react';
import { css } from 'emotion';
import { ThemeContext, LinkButton, CallToActionCard } from '@grafana/ui';
export const NoDataSourceCallToAction = () => {
const theme = useContext(ThemeContext);
const message =
'Explore requires at least one data source. Once you have added a data source, you can query it here.';
const footer = (
<>
<i className="fa fa-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="noopener"
className="text-link"
>
Learn more
</a>
</>
);
const ctaElement = (
<LinkButton size="lg" href="/datasources/new" icon="gicon gicon-datasources">
Add data source
</LinkButton>
);
const cardClassName = css`
max-width: ${theme.breakpoints.lg};
margin-top: ${theme.spacing.md};
align-self: center;
`;
return (
<CallToActionCard
callToActionElement={ctaElement}
className={cardClassName}
footer={footer}
message={message}
theme={theme}
/>
);
};