Changeset View
Changeset View
Standalone View
Standalone View
web/xec-web-components/util/templates/component.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}Props } from "./${componentName}.types"; | import { ${componentName}Props } from "./${componentName}.types"; | ||||
import "./${componentName}.css"; | |||||
const ${componentName}: React.FC<${componentName}Props> = ({ foo }) => ( | export const ${componentName}: React.FC<${componentName}Props> = ({ foo }) => ( | ||||
<div data-testid="${componentName}" className="foo-bar">{foo}</div> | <div data-testid="${componentName}" className="foo-bar">{foo}</div> | ||||
); | ); | ||||
export default ${componentName}; | |||||
`, | `, | ||||
extension: `.tsx`, | extension: `.tsx`, | ||||
}); | }); |