feat(insight): add new components for insights display and enhance styling

This commit is contained in:
DragonnZhang 2026-02-06 14:20:46 +08:00
parent f57e2619f1
commit afe911d06b
7 changed files with 1008 additions and 5 deletions

View file

@ -48,12 +48,23 @@ export class TemplateRenderer {
}
private async loadScripts(): Promise<string> {
const scriptsPath = path.join(
this.templateDir,
'scripts',
'insight-app.js',
const componentsDir = path.join(this.templateDir, 'scripts', 'components');
const componentFiles = [
'utils.js',
'Header.js',
'Qualitative.js',
'Charts.js',
'App.js',
];
const scripts = await Promise.all(
componentFiles.map((file) =>
fs.readFile(path.join(componentsDir, file), 'utf-8'),
),
);
return await fs.readFile(scriptsPath, 'utf-8');
return scripts.join('\n\n');
}
// Render the complete HTML file