UNPKG

agentic-ui-libs

Version:

A modular, config-driven analytics library for React and Angular applications

5 lines 2.09 kB
import { DashboardConfig, AppConfig } from '../types'; export declare const agenticAppConfig: AppConfig; export declare const apiEnabledDashboardConfig: DashboardConfig; export declare const angularIntegrationExample = "\n// In your Angular component (usage-analytics.component.ts)\nimport { Dashboard, apiEnabledDashboardConfig, agenticAppConfig } from '@agentic/ui-libs';\n\n@Component({\n selector: 'app-analytics-dashboard',\n template: '<div #dashboardContainer></div>',\n standalone: true\n})\nexport class AnalyticsDashboardComponent implements OnInit, AfterViewInit, OnDestroy {\n @ViewChild('dashboardContainer', { static: true }) \n dashboardContainer!: ElementRef;\n\n private root: Root | null = null;\n\n // Your actual app configuration\n private appConfig = {\n baseUrl: window.location.protocol + '//' + window.location.hostname,\n dashboardType: 'agenticDashboard' as const,\n projectId: 'your-project-id',\n environment: 'draft',\n headers: {\n 'authorization': 'Bearer your-token',\n 'accountId': 'your-account-id',\n 'Content-Type': 'application/json'\n }\n };\n\n ngAfterViewInit(): void {\n this.renderReactComponent();\n }\n\n private renderReactComponent(): void {\n if (this.dashboardContainer) {\n const element = React.createElement(Dashboard, {\n config: apiEnabledDashboardConfig,\n appConfig: this.appConfig,\n onExport: () => console.log('Export clicked'),\n onDraftChange: (value: string) => {\n console.log('Environment changed:', value);\n // Update your appConfig.environment and re-render if needed\n },\n onTimeRangeChange: (value: string) => {\n console.log('Time range changed:', value);\n // Update date range and re-render if needed\n }\n });\n\n this.root = createRoot(this.dashboardContainer.nativeElement);\n this.root.render(element);\n }\n }\n\n ngOnDestroy(): void {\n if (this.root) {\n this.root.unmount();\n }\n }\n}\n"; //# sourceMappingURL=apiDashboardConfig.d.ts.map