diff --git a/docs-ui/components/notAvailable.stories.js b/docs-ui/components/notAvailable.stories.js new file mode 100644 index 00000000000000..c26acbd06e48a2 --- /dev/null +++ b/docs-ui/components/notAvailable.stories.js @@ -0,0 +1,33 @@ +import React from 'react'; +import {withInfo} from '@storybook/addon-info'; + +import NotAvailable from 'app/components/notAvailable'; +import PanelTable from 'app/components/panels/panelTable'; + +export default { + title: 'Core/NotAvailable', +}; + +export const Default = withInfo( + "When you don't have data to display, but don't want to display an empty space. It's commonly used in a table." +)(() => ( +
+
+

Alone

+ +
+
+

In a Table

+ +
Panel Item with really long content
+
+ +
+
+
+
+)); + +Default.story = { + name: 'default', +}; diff --git a/src/sentry/static/sentry/app/components/notAvailable.tsx b/src/sentry/static/sentry/app/components/notAvailable.tsx new file mode 100644 index 00000000000000..c8e1db42b23847 --- /dev/null +++ b/src/sentry/static/sentry/app/components/notAvailable.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +import styled from '@emotion/styled'; + +function NotAvailable() { + return {'\u2014'}; +} + +const Wrapper = styled('div')` + color: ${p => p.theme.gray200}; +`; + +export default NotAvailable; diff --git a/tests/js/spec/components/notAvailable.spec.tsx b/tests/js/spec/components/notAvailable.spec.tsx new file mode 100644 index 00000000000000..2dce8a64fbe670 --- /dev/null +++ b/tests/js/spec/components/notAvailable.spec.tsx @@ -0,0 +1,12 @@ +import React from 'react'; + +import {mountWithTheme} from 'sentry-test/enzyme'; + +import NotAvailable from 'app/components/notAvailable'; + +describe('NotAvailable', function () { + it('renders', function () { + const wrapper = mountWithTheme(); + expect(wrapper.text()).toEqual('\u2014'); + }); +});