From 38abf92ddd54b30578cd4d424f23247874656a9b Mon Sep 17 00:00:00 2001
From: Osama Mabkhot <99215291+O2sa@users.noreply.github.com>
Date: Tue, 28 Jul 2026 00:29:13 +0300
Subject: [PATCH] refactor: add reusable Avatar component and integrate it into
leaderboard and result dashboard (#181)
---
components/avatar.tsx | 33 ++++++++++++++++++++++++++++++++
components/leaderboard-table.tsx | 8 +++-----
components/result-dashboard.tsx | 20 +++++++------------
next.config.js | 1 +
4 files changed, 44 insertions(+), 18 deletions(-)
create mode 100644 components/avatar.tsx
diff --git a/components/avatar.tsx b/components/avatar.tsx
new file mode 100644
index 0000000..95ade3b
--- /dev/null
+++ b/components/avatar.tsx
@@ -0,0 +1,33 @@
+import Image from "next/image";
+import { cn } from "@/lib/utils";
+
+type AvatarProps = {
+ src: string;
+ alt: string;
+ size?: number;
+ unoptimized?: boolean;
+ className?: string;
+};
+
+/**
+ * Reusable avatar image component.
+ *
+ */
+export function Avatar({
+ src,
+ alt,
+ size = 32,
+ unoptimized = true,
+ className,
+}: AvatarProps) {
+ return (
+