MCPcopy
hub / github.com/d3george/slash-admin / Component

Function Component

src/routes/sections/dashboard/utils.tsx:16–32  ·  view source on GitHub ↗
(path = "", props?: any)

Source from the content-addressed store, hash-verified

14};
15
16export const Component = (path = "", props?: any): React.ReactNode => {
17 if (!path) return null;
18
19 let importFn = Pages[`/src${path}.tsx`];
20 if (!importFn) importFn = Pages[`/src${path}/index.tsx`];
21 if (!importFn) {
22 console.warn("Component not found for path:", path);
23 return null;
24 }
25
26 let Element = lazyComponentCache.get(path);
27 if (!Element) {
28 Element = lazy(importFn as any);
29 lazyComponentCache.set(path, Element);
30 }
31 return <Element {...props} />;
32};

Callers 2

processItemFunction · 0.90

Calls 1

getMethod · 0.80

Tested by

no test coverage detected