From 9036534d8c2d0c3757d6dc84cfec25194502cf40 Mon Sep 17 00:00:00 2001 From: Aahna Ashina <95955389+aahna-ashina@users.noreply.github.com> Date: Mon, 12 Feb 2024 20:27:53 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=80=84=20feat:=20revocation=20count=20(#5?= =?UTF-8?q?1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #51 --- src/pages/index.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 648ba0a..f61226d 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -14,7 +14,7 @@ import Link from 'next/link' import LoadingIndicator from '@/components/LoadingIndicator' import { config } from '@/utils/Config' -export default function Home({ total_citizens_count, total_expired_passports, active_citizens_count, citizens, nationcred_scores_accumulated }: any) { +export default function Home({ total_citizens_count, total_expired_passports, total_revoked_passports, active_citizens_count, citizens, nationcred_scores_accumulated }: any) { console.log('Home') return (
@@ -28,7 +28,7 @@ export default function Home({ total_citizens_count, total_expired_passports, ac
{(total_citizens_count && active_citizens_count) ? ( - + ) : ( )} @@ -85,7 +85,7 @@ export default function Home({ total_citizens_count, total_expired_passports, ac ) } -function CitizenChart({ total_citizens_count, total_expired_passports, active_citizens_count }: any) { +function CitizenChart({ total_citizens_count, total_expired_passports, total_revoked_passports, active_citizens_count }: any) { const chartData = { series: [ { @@ -99,6 +99,10 @@ function CitizenChart({ total_citizens_count, total_expired_passports, active_ci { name: 'Expired Passports', data: total_expired_passports + }, + { + name: 'Revoked Passports', + data: total_revoked_passports } ], options: { @@ -149,6 +153,7 @@ export async function getStaticProps() { const citizenCountData = await citizenCountResponse.text() const total_citizens_count: number[] = [] const total_expired_passports: number[] = [] + const total_revoked_passports: number[] = [] Papa.parse(citizenCountData, { header: true, skipEmptyLines: true, @@ -159,9 +164,11 @@ export async function getStaticProps() { // console.info(`row ${i}`, row) total_citizens_count[i] = Number(row.total_citizens) total_expired_passports[i] = Number(row.total_expired_passports) + total_revoked_passports[i] = Number(row.total_revoked_passports) }) // console.info('total_citizens_count:', total_citizens_count) // console.info('total_expired_passports:', total_expired_passports) + // console.info('total_revoked_passports:', total_revoked_passports) } }) @@ -195,6 +202,7 @@ export async function getStaticProps() { props: { total_citizens_count, total_expired_passports, + total_revoked_passports, active_citizens_count, citizens, nationcred_scores_accumulated