diff --git a/src/app/page.tsx b/src/app/page.tsx index 66c94dd..5149103 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -2,17 +2,8 @@ import PostsList from "@/components/PostComponents/PostsList"; export default function HomePage() { return ( -
-
-
-
-

SentioPulse

-
-
-
-
); } diff --git a/src/components/HomepageComponents/BullishMarketCard.tsx b/src/components/HomepageComponents/BullishMarketCard.tsx new file mode 100644 index 0000000..a04a68c --- /dev/null +++ b/src/components/HomepageComponents/BullishMarketCard.tsx @@ -0,0 +1,137 @@ +"use client"; +import { + Card, + CardAction, + CardContent, + CardDescription, + CardFooter, + CardHeader, + CardTitle, +} from "../ui/card"; +import { FaRegChartBar } from "react-icons/fa"; +import { CiCalendar } from "react-icons/ci"; + +// Mock data representing overall sentiment and source aggregation +const MockData = { + totalSourceCount: 1247, // explicit total source count for display + sentimentCounts: { + BULLISH: 812, + NEUTRAL: 215, + BEARISH: 220, + }, + get sentimentPercentages(): { + BULLISH: number; + NEUTRAL: number; + BEARISH: number; + } { + const { BULLISH, NEUTRAL, BEARISH } = this.sentimentCounts; + const total = BULLISH + NEUTRAL + BEARISH; + return { + BULLISH: Math.round((BULLISH / total) * 100), + NEUTRAL: Math.round((NEUTRAL / total) * 100), + BEARISH: Math.round((BEARISH / total) * 100), + }; + }, + updatedAt: new Date("2025-09-16T09:55:00Z"), // Fixed date for SSR compatibility + get minutesAgo() { + return Math.floor((Date.now() - this.updatedAt.getTime()) / 60000); + }, +}; + +export default function BullishMarketCard() { + return ( +
+ + +
+ Bullish Market + + + + + + {MockData.totalSourceCount} Sources + + +
+ +
+ + {MockData.sentimentPercentages.BULLISH}% + + Bullish +
+
+ + {MockData.sentimentPercentages.NEUTRAL}% + + Neutral +
+
+ + {MockData.sentimentPercentages.BEARISH}% + + Bearish +
+
+
+ +
+
+ + + {MockData.sentimentPercentages.BULLISH}% + +
+
+ + + {MockData.sentimentPercentages.NEUTRAL}% + +
+
+ + + {MockData.sentimentPercentages.BEARISH}% + +
+
+
+ +
+ + + + + Updated {MockData.minutesAgo} minutes ago + +
+
+
+
+ ); +} diff --git a/src/components/PostComponents/PostGallery.tsx b/src/components/PostComponents/PostGallery.tsx index 13fc099..c75ab9a 100644 --- a/src/components/PostComponents/PostGallery.tsx +++ b/src/components/PostComponents/PostGallery.tsx @@ -191,7 +191,7 @@ export default function PostsGallery({ posts = mockPostsData, }: PostsGalleryProps) { return ( -
+
{posts.map((post, index) => ( ))} diff --git a/src/components/PostComponents/PostsList.tsx b/src/components/PostComponents/PostsList.tsx index ec1e560..e1a321c 100644 --- a/src/components/PostComponents/PostsList.tsx +++ b/src/components/PostComponents/PostsList.tsx @@ -6,6 +6,7 @@ import { SortField, SortOrder } from "./PostSortSelect"; import Spinner from "./Spinner"; import type { Post } from "@prisma/client"; import PostGallery from "./PostGallery"; +import BullishMarketCard from "../HomepageComponents/BullishMarketCard"; export default function PostsList() { const [error, setError] = useState(null); @@ -101,6 +102,7 @@ export default function PostsList() { search={search} onSearchChange={onChangeHandler} /> +
);