2025-07-02 18:46:37 +03:00
|
|
|
import React, { useMemo } from 'react';
|
|
|
|
|
|
2025-07-08 23:46:00 +05:30
|
|
|
import { ModuleProps } from '@app/homeV3/module/types';
|
|
|
|
|
import SampleLargeModule from '@app/homeV3/modules/SampleLargeModule';
|
|
|
|
|
import YourAssetsModule from '@app/homeV3/modules/YourAssetsModule';
|
2025-07-02 18:46:37 +03:00
|
|
|
|
2025-07-08 17:47:11 -04:00
|
|
|
import { DataHubPageModuleType } from '@types';
|
|
|
|
|
|
2025-07-02 18:46:37 +03:00
|
|
|
export default function Module(props: ModuleProps) {
|
2025-07-08 17:47:11 -04:00
|
|
|
const { module } = props;
|
2025-07-02 18:46:37 +03:00
|
|
|
const Component = useMemo(() => {
|
2025-07-08 17:47:11 -04:00
|
|
|
if (module.properties.type === DataHubPageModuleType.OwnedAssets) return YourAssetsModule;
|
|
|
|
|
// TODO: remove the sample large module once we have other modules to fill this out
|
|
|
|
|
console.error(`Issue finding module with type ${module.properties.type}`);
|
2025-07-02 18:46:37 +03:00
|
|
|
return SampleLargeModule;
|
2025-07-08 17:47:11 -04:00
|
|
|
}, [module.properties.type]);
|
2025-07-02 18:46:37 +03:00
|
|
|
|
2025-07-08 17:47:11 -04:00
|
|
|
return <Component module={module} />;
|
2025-07-02 18:46:37 +03:00
|
|
|
}
|