mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-22 05:02:18 +08:00
17 lines
443 B
JavaScript
17 lines
443 B
JavaScript
|
import React from 'react';
|
||
|
import { storiesOf } from '@kadira/storybook';
|
||
|
import implementations from './implementations';
|
||
|
|
||
|
const storyGroups = {};
|
||
|
|
||
|
for (const key in implementations) {
|
||
|
const [groupName, itemName] = key.split('.');
|
||
|
const implementation = implementations[key];
|
||
|
|
||
|
if (!storyGroups[groupName]) {
|
||
|
storyGroups[groupName] = storiesOf(groupName, module);
|
||
|
}
|
||
|
|
||
|
storyGroups[groupName].add(itemName, () => implementation);
|
||
|
}
|