@muban/storybook
Version:
Storybook for Muban: View and Test Muban components.
16 lines (15 loc) • 738 B
JavaScript
import {} from '@storybook/types';
import {} from '../types.js';
import { getClientTemplateArgs } from '../utils/getTemplateArgs.js';
export function renderClientTemplate(app, container, componentStory,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
data, { argTypes }) {
const sanitizedStoryArgs = getClientTemplateArgs(data, argTypes);
if (app) {
// the `app.mount` types are wrong here
// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression
return app.mount(container, componentStory.template, sanitizedStoryArgs);
}
// only render the basic template
container.innerHTML = [componentStory.template(sanitizedStoryArgs)].flat().join('');
}