mirror of
https://github.com/Tomato6966/investment-portfolio-simulator.git
synced 2025-04-04 14:50:35 +02:00
37 lines
1.5 KiB
TypeScript
37 lines
1.5 KiB
TypeScript
import { lazy, Suspense } from "react";
|
|
|
|
import { LoadingPlaceholder } from "../utils/LoadingPlaceholder";
|
|
|
|
const AddAssetModal = lazy(() => import("../Modals/AddAssetModal"));
|
|
const InvestmentFormWrapper = lazy(() => import("../InvestmentForm"));
|
|
const PortfolioChart = lazy(() => import("../PortfolioChart"));
|
|
const PortfolioTable = lazy(() => import("../PortfolioTable"));
|
|
|
|
|
|
export default function MainContent({ isAddingAsset, setIsAddingAsset }: { isAddingAsset: boolean, setIsAddingAsset: (value: boolean) => void }) {
|
|
return (
|
|
<>
|
|
<div className="grid grid-cols-1 lg:grid-cols-4 gap-8 mb-8 dark:text-gray-300">
|
|
<div className="col-span-3">
|
|
<Suspense fallback={<LoadingPlaceholder className="h-[500px]" />}>
|
|
<PortfolioChart />
|
|
</Suspense>
|
|
</div>
|
|
<div className="col-span-3 lg:col-span-1">
|
|
<Suspense fallback={<LoadingPlaceholder className="h-[500px]" />}>
|
|
<InvestmentFormWrapper />
|
|
</Suspense>
|
|
</div>
|
|
</div>
|
|
<Suspense fallback={<LoadingPlaceholder className="h-[500px]" />}>
|
|
<PortfolioTable />
|
|
</Suspense>
|
|
|
|
{isAddingAsset && (
|
|
<Suspense>
|
|
<AddAssetModal onClose={() => setIsAddingAsset(false)} />
|
|
</Suspense>
|
|
)}
|
|
</>
|
|
);
|
|
};
|