Files
yellowbird/src/components/modules/HomepageModules.tsx
T
2024-03-04 13:22:19 -05:00

132 lines
3.7 KiB
TypeScript

import {
heatmapData,
newsData,
portfolioData,
winnerMovers,
loserMovers,
} from "@/app/MockData/MockData";
import HomepageModule from "./HomepageModuleCard";
import MarketHeatmap from "../charts/MarketHeatmap";
import { Button } from "../ui/button";
import { ArrowRight, Divide } from "lucide-react";
import { NewsTable } from "../charts/news/NewsTable";
import { newsColumns } from "../charts/news/newsColumns";
import Chart from "../charts/Chart";
export const PortfolioModule = () => {
return (
<HomepageModule title="Portfolio">
<div className="flex justify-between px-4">
<div>$34,120.87</div>
<div className="rounded-full bg-neutral-900 px-4">2W 1M YTD</div>
<div className="text-green-500">^10.0% $3,412.09</div>
</div>
<div className="h-3/4">
<Chart
data={portfolioData}
colors={{
backgroundColor: "transparent",
textColor: "white",
}}
/>
</div>
<div className="flex justify-between">
<Button className="text-white" variant="link">
Go to Portfolio
<ArrowRight className="ml-1" size={16} />
</Button>
</div>
</HomepageModule>
);
};
export const NewsModule = () => {
return (
<HomepageModule title="News">
<NewsTable columns={newsColumns} data={newsData} />
</HomepageModule>
);
};
export const HeatmapModule = () => {
return (
<HomepageModule title="Heatmap">
<MarketHeatmap data={heatmapData} />
</HomepageModule>
);
};
export const MoversModule = () => {
return (
<HomepageModule title="Movers">
<div className="flex justify-between 2xl:px-2">
<div className="px-4 mt-4 2xl:mt-6">
<div className="text-lg">Gainers</div>
<div className="mt-4 grid grid-cols-2 grid-rows-5 gap-y-4 gap-x-2 2xl:gap-y-6 2xl:gap-x-10">
{winnerMovers.map((item) => (
<div
className="flex border-b border-neutral-400 pb-1 text-sm 2xl:text-base"
key={item.symbol}
>
<div className="w-32 font-bold 2xl:w-24">{item.symbol}</div>
<div className="text-xs text-right text-neutral-400 2xl:w-20 2xl:text-base">
{item.stockPrice}
</div>
<div className="text-xs ml-2 rounded-lg bg-green-700 bg-opacity-90 w-20 text-center 2xl:ml-4 2xl:text-base">
+{item.percentChange}%
</div>
</div>
))}
</div>
</div>
<div className="px-4 mt-4 2xl:mt-6">
<div className="text-lg">Losers</div>
<div className="mt-4 grid grid-cols-2 grid-rows-5 gap-y-4 gap-x-2 2xl:gap-y-6 2xl:gap-x-10">
{loserMovers.map((item) => (
<div
className="flex border-b border-neutral-400 pb-1 text-sm 2xl:text-base"
key={item.symbol}
>
<div className="w-32 font-bold 2xl:w-24">{item.symbol}</div>
<div className="text-xs text-right text-neutral-400 2xl:w-20 2xl:text-base">
{item.stockPrice}
</div>
<div className="text-xs ml-2 rounded-lg bg-red-700 bg-opacity-90 w-20 text-center 2xl:ml-4 2xl:text-base">
{item.percentChange}%
</div>
</div>
))}
</div>
</div>
</div>
</HomepageModule>
);
};
export const MarketsModule = () => {
return (
<HomepageModule title="Markets">
<div className="w-full">
<div className="w-1/2"></div>
<div className="w-1/2 border-blue-200 border"></div>
</div>
</HomepageModule>
);
};
export const EarningsModule = () => {
return <HomepageModule title="Earnings"></HomepageModule>;
};
export const DocumentsModule = () => {
return <HomepageModule title="Documents"></HomepageModule>;
};
export const IndicatorsModule = () => {
return <HomepageModule title="Indicators"></HomepageModule>;
};
export const ForexAndBondsModule = () => {
return <HomepageModule title="Forex and Bonds"></HomepageModule>;
};