mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 21:21:47 +08:00
15 lines
380 B
JavaScript
15 lines
380 B
JavaScript
/* eslint-disable import/extensions */
|
|
import { html } from 'lit-html';
|
|
import { styleMap } from 'lit-html/directives/style-map.js';
|
|
|
|
/**
|
|
* Helper component for rendering text or data
|
|
*/
|
|
export const Pre = ({ style, object, text }) =>
|
|
html`
|
|
<pre data-testid="pre" style=${styleMap({ style })}>
|
|
${object ? JSON.stringify(object, null, 2) : text}
|
|
</pre
|
|
>
|
|
`;
|