export default function template(files) { const exportLines = files.map((file) => { const { path } = file; const fileName = path.split('/').pop(); const componentNameWithExt = fileName.replace(/\.tsx$/, '.js'); const componentName = fileName.replace(/\.tsx$/, ''); return `export { default as ${componentName} } from './${componentNameWithExt}';`; }); const header = '/* This file is automatically generated by the build:icons script. Do not modify it manually.*/\n\n '; return header + exportLines.join('\n'); };