+ {topUsers.map((user, idx) => {
+ const rankColor =
+ idx === 0
+ ? "text-yellow-400 drop-shadow-[0_0_8px_rgba(250,204,21,0.4)]"
+ : idx === 1
+ ? "text-gray-300 drop-shadow-[0_0_8px_rgba(209,213,219,0.4)]"
+ : "text-amber-600 drop-shadow-[0_0_8px_rgba(217,119,6,0.4)]";
+
+ const badgeInfo = getBadgeInfo(user.rank, user.hours);
+ const initial = (user.email?.[0] || "?").toUpperCase();
-
-
-
-
- {topLanguage}
-
-
+ return (
+
+ {/* Minimal Background Glow based on rank */}
+
-
+
+
+
+ {initial}
+
+
+
+ {user.email?.split("@")[0] || "Unknown"}
+
+
+ {badgeInfo.icon && (
+
+ )}
+ {badgeInfo.label}
+
+
+
+
+
+
+ {idx === 0 ? "01" : idx === 1 ? "02" : "03"}
+
+
+
-
-
-
-
-
+ {/* Stats Row */}
+
+
+
+ Hours
+
+
+ {user.hours}
+
+
+
+
+ Language
+
+
+ {user.languages?.[0] || "N/A"}
+
+
+
+
+ Editor
+
+
+ {user.editor || "N/A"}
+
+
+
-
- OS
-
-
-
- {topOS}
-
-
+ );
+ })}
);
}
-const getBadgeInfo = (rank: number, hours: number) => {
- if (rank === 1)
- return { label: "GOD LEVEL", class: "badge-god", icon: faBolt };
- if (rank === 2) return { label: "ELITE", class: "badge-elite", icon: faFire };
- if (rank === 3) return { label: "PRO", class: "badge-pro", icon: faStar };
- if (hours > 100)
- return { label: "MASTER", class: "badge-master", icon: faRocket };
- if (hours > 20)
- return { label: "HUSTLER", class: "badge-hustler", icon: null };
- return { label: "NOVICE", class: "badge-novice", icon: null };
-};
+import LeaderboardStats from "./leaderboard/LeaderboardStats";
export default function LeaderboardTable({
members,
@@ -188,7 +165,7 @@ export default function LeaderboardTable({
};
return (
-
+
+
- {ranked.length === 0 ? (
-
-
+
+
+
+ {ranked.length === 0 ? (
+
+
No tracking data available yet.
@@ -263,15 +280,15 @@ export default function LeaderboardTable({
{/* Header Row (Desktop) */}
Rank
-
Developer
-
Tech Stack
-
Environment
-
Score
+
Developer
+
Language
+
Editor
+
Hours
{/* List Body */}
- {ranked.map((user) => {
+ {ranked.slice(3).map((user) => {
const isCurrentUser = user.user_id === ownerId;
const pct = Math.max(2, (user.hours / maxHours) * 100);
const badgeInfo = getBadgeInfo(user.rank, user.hours);
@@ -293,7 +310,7 @@ export default function LeaderboardTable({
)}
{/* MOBILE TOP ROW / DESKTOP LEFT FLEX */}
-
+
{/* Rank */}
- {user.email.charAt(0)}
+ {user.email?.charAt(0) || "?"}
- {user.email.split("@")[0]}
+ {user.email?.split("@")[0] || "Unknown"}
{isCurrentUser && (
@@ -346,8 +363,8 @@ export default function LeaderboardTable({
{/* MOBILE BOTTOM STACK / DESKTOP RIGHT ROW */}
- {/* Tech Stack */}
-
+ {/* Language */}
+
{user.languages.length > 0 ? (
user.languages.map((lang, i) => (
- {/* Environment */}
-
+ {/* Editor */}
+
{user.editor !== "N/A" && (
{user.editor}
@@ -397,6 +414,42 @@ export default function LeaderboardTable({
)}
+
+
+ {/* Rankings Legend */}
+
+
+
+ Rankings Legend
+
+
+ {[
+ { hours: 160, label: "MISSION IMPOSSIBLE" },
+ { hours: 130, label: "GOD LEVEL" },
+ { hours: 100, label: "STARLIGHT" },
+ { hours: 50, label: "ELITE" },
+ { hours: 20, label: "PRO" },
+ { hours: 5, label: "NOVICE" },
+ { hours: 1, label: "NEWBIE" },
+ { hours: 0, label: "none" },
+ ].map((item) => {
+ const b = getBadgeInfo(0, item.hours);
+ return (
+
+
+ {b.icon && }
+ {b.label}
+
+
+ {item.hours === 0 ? "0 hrs" : `${item.hours}+`}
+
+
+ );
+ })}
+
+
+
+
);
-}
+}
\ No newline at end of file
diff --git a/app/components/chat/Conversations.tsx b/app/components/chat/Conversations.tsx
index 4ca8cdc..a675119 100644
--- a/app/components/chat/Conversations.tsx
+++ b/app/components/chat/Conversations.tsx
@@ -1,3 +1,4 @@
+"use client";
import { User } from "@supabase/supabase-js";
import { Conversation } from "../Chat";
@@ -32,3 +33,4 @@ export default function Conversations({
>
);
}
+
diff --git a/app/components/chat/Messages.tsx b/app/components/chat/Messages.tsx
index f815fe2..cddeae0 100644
--- a/app/components/chat/Messages.tsx
+++ b/app/components/chat/Messages.tsx
@@ -53,13 +53,15 @@ export default function Messages({
return (
<>
- {/* @ts-expect-error atomDark style type not compatible with SyntaxHighlighter */}
+ { }
+
)}
>
{String(children).replace(/\n$/, "")}
diff --git a/app/components/dashboard/Navbar.tsx b/app/components/dashboard/Navbar.tsx
index 1f30752..587e49d 100644
--- a/app/components/dashboard/Navbar.tsx
+++ b/app/components/dashboard/Navbar.tsx
@@ -10,7 +10,6 @@ import {
faTrophy,
faChevronLeft,
faChevronRight,
- faGear,
faMessage,
} from "@fortawesome/free-solid-svg-icons";
import type { IconDefinition } from "@fortawesome/free-solid-svg-icons";
diff --git a/app/components/dashboard/widgets/StatsCard.tsx b/app/components/dashboard/widgets/StatsCard.tsx
index b9a73aa..efc5ea3 100644
--- a/app/components/dashboard/widgets/StatsCard.tsx
+++ b/app/components/dashboard/widgets/StatsCard.tsx
@@ -1,3 +1,4 @@
+"use client";
export interface StatCard {
label: string;
value: string;
@@ -72,3 +73,4 @@ export default function StatsCard({
);
}
+
diff --git a/app/components/landing-page/TopLeaderbord.tsx b/app/components/landing-page/TopLeaderbord.tsx
index 52db441..af33bbd 100644
--- a/app/components/landing-page/TopLeaderbord.tsx
+++ b/app/components/landing-page/TopLeaderbord.tsx
@@ -1,18 +1,7 @@
-export interface Category {
- name: string;
- text: string;
- hours: number;
- decimal: string;
- digital: string;
- minutes: number;
- percent: number;
- total_seconds: number;
-}
-
export interface TopMember {
email: string;
total_seconds: number;
- categories?: Category[];
+ categories?: { name: string; total_seconds: number }[];
}
export default function TopLeaderboard({
diff --git a/app/components/leaderboard/BackButton.tsx b/app/components/leaderboard/BackButton.tsx
index 9029387..cff840a 100644
--- a/app/components/leaderboard/BackButton.tsx
+++ b/app/components/leaderboard/BackButton.tsx
@@ -4,12 +4,12 @@ import { useRouter } from "next/navigation";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faArrowLeft } from "@fortawesome/free-solid-svg-icons";
-export default function BackButton() {
+export default function BackButton({ href = "/dashboard/leaderboards" }: { href?: string }) {
const router = useRouter();
return (