mirror of
https://github.com/prodigist/ReactiveNotes.git
synced 2026-07-22 12:30:26 +00:00
Remove unused files and dependencies
This commit is contained in:
parent
5e3a5b4914
commit
553abee6fa
1 changed files with 0 additions and 47 deletions
|
|
@ -1,47 +0,0 @@
|
|||
// src/core/registry.tsx
|
||||
import React, { FC, ComponentProps } from 'react';
|
||||
import { dynamic, dynamicNamed } from './dynamic';
|
||||
|
||||
interface Registry {
|
||||
PieChart: FC<ComponentProps<any>>;
|
||||
Chart: FC<ComponentProps<any>>;
|
||||
ForceGraph2D: FC<ComponentProps<any>>;
|
||||
[key: string]: FC<ComponentProps<any>>; // Add index signature
|
||||
Pie: FC<ComponentProps<any>>;
|
||||
Cell: FC<ComponentProps<any>>;
|
||||
ResponsiveContainer: FC<ComponentProps<any>>;
|
||||
Tooltip: FC<ComponentProps<any>>;
|
||||
Legend: FC<ComponentProps<any>>;
|
||||
}
|
||||
|
||||
export const ComponentRegistry: Registry = {
|
||||
// For named exports from recharts, use dynamicNamed
|
||||
PieChart: dynamicNamed(() =>
|
||||
import('recharts').then(mod => mod.PieChart)
|
||||
),
|
||||
Pie: dynamicNamed(() =>
|
||||
import('recharts').then(mod => mod.Pie)
|
||||
),
|
||||
Cell: dynamicNamed(() =>
|
||||
import('recharts').then(mod => mod.Cell)
|
||||
),
|
||||
ResponsiveContainer: dynamicNamed(() =>
|
||||
import('recharts').then(mod => mod.ResponsiveContainer)
|
||||
),
|
||||
Tooltip: dynamicNamed(() =>
|
||||
import('recharts').then(mod => mod.Tooltip)
|
||||
),
|
||||
Legend: dynamicNamed(() =>
|
||||
import('recharts').then(mod => mod.Legend)
|
||||
),
|
||||
|
||||
// For components with default exports, use dynamic
|
||||
Chart: dynamic(() => import('react-apexcharts')),
|
||||
ForceGraph2D: dynamicNamed(() =>
|
||||
import('react-force-graph').then(mod => mod.ForceGraph2D)
|
||||
)
|
||||
};
|
||||
|
||||
export const getRegisteredComponent = (name: string): FC<ComponentProps<any>> | null => {
|
||||
return ComponentRegistry[name] || null;
|
||||
};
|
||||
Loading…
Reference in a new issue