UNPKG

@omni-door/tpl-ssr-react

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