import styled from '@emotion/styled';
import {KeyValueTable, KeyValueTableRow} from 'sentry/components/keyValueTable';
import QuestionTooltip from 'sentry/components/questionTooltip';
import * as SidebarSection from 'sentry/components/sidebarSection';
import Tag from 'sentry/components/tag';
import TextOverflow from 'sentry/components/textOverflow';
import Tooltip from 'sentry/components/tooltip';
import space from 'sentry/styles/space';
export default {
title: 'Views/Sidebar Section',
component: SidebarSection,
argTypes: {
title: {control: {type: 'text'}},
icon: {
control: {type: 'boolean'},
},
},
};
export const Default = ({title, icon}) => (
{title}
{icon && }
{'16 hours'}
);
Default.storyName = 'With text';
Default.parameters = {
docs: {
description: {
story: 'Generic sidebar section with text.',
},
},
};
Default.args = {
title: 'Subheading',
icon: false,
};
export const WithIconTagsText = ({title, icon}) => (
{title}
{icon && }
{'Adopted'}
{'in production'}
);
WithIconTagsText.storyName = 'With Icon, Tags, and Text';
WithIconTagsText.parameters = {
docs: {
description: {
story: 'Sidebar section that has an icon, tag, and text.',
},
},
};
WithIconTagsText.args = {
title: 'Icon, Tag, and Text',
icon: true,
};
export const WithRows = ({title, icon}) => (
{title}
{icon && }
{'Nov 17, 2021 5:36 PM'}}
/>
{'3.3.3'}}
/>
{'frontend'}}
/>
{'\u2014'}}
/>
{'\u2014'}}
/>
{'333 artifacts'}}
/>
);
WithRows.storyName = 'With Multiple Rows';
WithRows.parameters = {
docs: {
description: {
story:
'Section of the sidebar with multiple rows using the KeyValueTable component (label with date, etc).',
},
},
};
WithRows.args = {
title: 'With Multiple Rows',
icon: false,
};
const Environment = styled('span')`
color: ${p => p.theme.textColor};
margin-left: ${space(0.5)};
font-size: ${p => p.theme.fontSizeSmall};
`;
const StyledTextOverflow = styled(TextOverflow)`
line-height: inherit;
text-align: right;
`;