Changeset View
Changeset View
Standalone View
Standalone View
web/xec-web-components/util/templates/component.stories.js
module.exports = componentName => ({ | module.exports = componentName => ({ | ||||
content: `// Generated with util/create-component.js | content: `// Generated with util/create-component.js | ||||
import React from "react"; | import React from "react"; | ||||
import ${componentName} from "./${componentName}"; | import { ${componentName} } from "./${componentName}"; | ||||
export default { | export default { | ||||
title: "${componentName}" | title: "${componentName}" | ||||
}; | }; | ||||
export const WithBar = () => <${componentName} foo="bar" />; | export const WithBar = () => <${componentName} foo="bar" />; | ||||
export const WithBaz = () => <${componentName} foo="baz" />; | export const WithBaz = () => <${componentName} foo="baz" />; | ||||
`, | `, | ||||
extension: `.stories.tsx`, | extension: `.stories.tsx`, | ||||
}); | }); |