UNPKG

@omni-door/tpl-ssr-react

Version:
10 lines (9 loc) 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.tpl_new_class = void 0; var utils_1 = require("@omni-door/utils"); var tpl = "`import { PureComponent } from 'react';\n${style ? `import styles from './style/${componentName}.module.${style === 'all' ? 'scss' : style}';` : ''}\n${ts ? `/* import types */\nimport type { PropsWithChildren } from 'react';\n\nexport interface ${componentName}Props {}\n\nexport interface ${componentName}States {}\n` : ''}\nexport class ${componentName} extends PureComponent${ts ? `<PropsWithChildren<${componentName}Props>, ${componentName}States>` : ''} {\n ${ts ? 'public ' : ''}render() {\n const { children } = this.props;\n\n return (\n <div\n className={${style ? `styles.${componentName}` : `'${componentName}'`}}\n >\n { children }\n </div>\n );\n }\n}\n\nexport default ${componentName};\n`"; exports.tpl_new_class = { tpl: tpl }; exports.default = utils_1.tplEngineNew(exports.tpl_new_class, 'tpl');