diff --git a/package.json b/package.json index 8173e076..ee63a3fd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "explorer-dapp", "description": "Itheum Explorer is a DApp for the public to explore and visualize data within the Itheum protocol", - "version": "1.22.1", + "version": "1.22.2", "author": "Itheum", "license": "GPL-3.0-or-later", "dependencies": { diff --git a/src/pages/AIWorkforce/AIWorkforce.tsx b/src/pages/AIWorkforce/AIWorkforce.tsx index 2717abcc..4cfa12da 100644 --- a/src/pages/AIWorkforce/AIWorkforce.tsx +++ b/src/pages/AIWorkforce/AIWorkforce.tsx @@ -180,3 +180,34 @@ export const AIWorkforce = () => { ); }; + +export const AIWorkforceTopN = ({ showItems }: { showItems?: number }) => { + const [appBootingUp, setAppBootingUp] = useState(true); + const [rankedWorkforce, setRankedWorkforce] = useState([]); + + useEffect(() => { + async function getDataAndInitGraphData() { + setAppBootingUp(true); + const workforceDataList = await getWorkforceData(); + setRankedWorkforce(workforceDataList); + setAppBootingUp(false); + } + + getDataAndInitGraphData(); + }, []); + + async function getWorkforceData() { + const apiResponse = await axios.get(`${backendApi()}/workforce?size=${showItems || 5}`); + const dataResponse = apiResponse.data; + + return dataResponse; + } + + return ( +
+
+
{appBootingUp ? <>Loading : }
+
+
+ ); +}; diff --git a/src/pages/AIWorkforce/SharedComps.tsx b/src/pages/AIWorkforce/SharedComps.tsx index f77624da..264ad297 100644 --- a/src/pages/AIWorkforce/SharedComps.tsx +++ b/src/pages/AIWorkforce/SharedComps.tsx @@ -20,12 +20,15 @@ export function WorkersSnapShotGrid({ snapShotData }: { snapShotData: any[] }) { Rank: {idx + 1} - {worker.vault} -
-

{worker.vault}

-

Score: {worker.rankScore?.toLocaleString()}

-

Bonded Amount: {worker.bondAmount?.toLocaleString()}

-

Liveliness Score: {worker.livelinessScore?.toLocaleString()}

+
+ {worker.vault} +
+

{worker.vault}

+

Rank Score: {worker.rankScore?.toLocaleString()}

+

Total Bond: {worker.bondAmount?.toLocaleString()}

+

Liveliness Score: {worker.livelinessScore?.toLocaleString()}

+

BiTz XP: {worker.bitzXp?.toLocaleString()}

+
))} diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 8148cb99..72ade2b1 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -8,6 +8,7 @@ import TrendingSection from "components/TrendingSection"; import { APP_MAPPINGS } from "libs/utils/constant"; import { routeNames } from "routes"; import { Button } from "../libComponents/Button"; +import { AIWorkforceTopN } from "../pages/AIWorkforce/AIWorkforce"; import { AnalyticsSnapshot } from "../pages/Analytics/AnalyticsSnapshot"; export function returnRoute(routeKey: string) { @@ -50,7 +51,7 @@ export const Home = () => { -
+

Featured Apps

@@ -80,7 +81,27 @@ export const Home = () => {
-
+
+ +
+

Top 5 Ranked Itheum AI Workforce

+
+ +
+
+ +
+
+ +
+
+ +
+
+ +

Protocol Activity

@@ -100,7 +121,7 @@ export const Home = () => {
-
+

All Apps

@@ -130,14 +151,14 @@ export const Home = () => {
-
+
-
+
); };