UNPKG

686 BJavaScriptView Raw
1import React, { useContext } from 'react';
2import { Subtitle as PureSubtitle } from '@storybook/components';
3import { DocsContext } from './DocsContext';
4export var Subtitle = function Subtitle(_ref) {
5 var children = _ref.children;
6
7 var _useContext = useContext(DocsContext),
8 id = _useContext.id,
9 storyById = _useContext.storyById;
10
11 var _storyById = storyById(id),
12 parameters = _storyById.parameters;
13
14 var text = children;
15
16 if (!text) {
17 text = parameters === null || parameters === void 0 ? void 0 : parameters.componentSubtitle;
18 }
19
20 return text ? /*#__PURE__*/React.createElement(PureSubtitle, {
21 className: "sbdocs-subtitle"
22 }, text) : null;
23};
\No newline at end of file