mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-20 05:02:37 +08:00
16 lines
426 B
JavaScript
16 lines
426 B
JavaScript
import { storiesOf } from '@storybook/react';
|
|
import implementations from './implementations';
|
|
|
|
const storyGroups = {};
|
|
|
|
Object.keys(implementations).forEach(key => {
|
|
const [groupName, itemName] = key.split('.');
|
|
const implementation = implementations[key];
|
|
|
|
if (!storyGroups[groupName]) {
|
|
storyGroups[groupName] = storiesOf(groupName, module);
|
|
}
|
|
|
|
storyGroups[groupName].add(itemName, () => implementation);
|
|
});
|