|
1
|
import { DashboardApp } from "./dashboard-app" |
|
2
|
import { DashboardPlugin } from "./dashboard-app/types" |
|
3
|
|
|
4
|
import displayModule from "virtual:medusa/displays" |
|
5
|
import formModule from "virtual:medusa/forms" |
|
6
|
import i18nModule from "virtual:medusa/i18n" |
|
7
|
import layoutModule from "virtual:medusa/layouts" |
|
8
|
import menuItemModule from "virtual:medusa/menu-items" |
|
9
|
import routeModule from "virtual:medusa/routes" |
|
10
|
import widgetModule from "virtual:medusa/widgets" |
|
11
|
import "virtual:medusa/cell-renderers" |
|
12
|
import "virtual:medusa/search-entities" |
|
13
|
|
|
14
|
import { defineCellRenderer } from "./lib/table/cell-renderers" |
|
15
|
import { |
|
16
|
clearSearchEntities, |
|
17
|
defineSearchEntity, |
|
18
|
} from "./lib/search/search-entities" |
|
19
|
|
|
20
|
import "./index.css" |
|
21
|
|
|
22
|
import { registerReloadOnPreloadError } from "./lib/reload-on-preload-error" |
|
23
|
|
|
24
|
if (typeof window !== "undefined") { |
|
25
|
registerReloadOnPreloadError() |
|
26
|
} |
|
27
|
|
|
28
|
const localPlugin = { |
|
29
|
widgetModule, |
|
30
|
routeModule, |
|
31
|
displayModule, |
|
32
|
formModule, |
|
33
|
menuItemModule, |
|
34
|
i18nModule, |
|
35
|
layoutModule, |
|
36
|
} |
|
37
|
|
|
38
|
interface AppProps { |
|
39
|
plugins?: DashboardPlugin[] |
|
40
|
} |
|
41
|
|
|
42
|
function App({ plugins = [] }: AppProps) { |
|
43
|
const app = new DashboardApp({ |
|
44
|
plugins: [localPlugin, ...plugins], |
|
45
|
}) |
|
46
|
|
|
47
|
return <div>{app.render()}</div> |
|
48
|
} |
|
49
|
|
|
50
|
export { defineCellRenderer, defineSearchEntity, clearSearchEntities } |
|
51
|
export default App |