From 9cbf6e8af4ca867fd9dd45b12905fc1acf8276cd Mon Sep 17 00:00:00 2001 From: dharamveergit Date: Thu, 26 Sep 2024 14:54:05 +0530 Subject: [PATCH] update gpu-table.tsx and pricing-header.astro --- .../pricing-page/gpus/gpu-table.tsx | 24 +++++++++++++------ .../pricing-page/pricing-header.astro | 5 ---- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/components/pricing-page/gpus/gpu-table.tsx b/src/components/pricing-page/gpus/gpu-table.tsx index 407caff0..281409ed 100644 --- a/src/components/pricing-page/gpus/gpu-table.tsx +++ b/src/components/pricing-page/gpus/gpu-table.tsx @@ -105,14 +105,24 @@ const Table = ({ ); }; +const modelTexts: Record = { + rtx: "RTX ", + gtx: "GTX ", + ti: " Ti", + ada: " ADA", +}; + +const formatText = (model: string) => { + let formattedText = model; + for (const key in modelTexts) { + const regex = new RegExp(key, "gi"); + formattedText = formattedText.replace(regex, modelTexts[key]); + } + + return formattedText; +}; export const modifyModel = (model: string) => { - return model === "rtxa6000" - ? "A6000" - : model?.includes("rtx") - ? model?.replace("rtx", "RTX ").replace("ti", " Ti") - : model?.includes("gtx") - ? model?.replace("gtx", "GTX ").replace("ti", " Ti") - : model; + return model === "rtxa6000" ? "A6000" : formatText(model); }; export const price = (price: number) => { diff --git a/src/components/pricing-page/pricing-header.astro b/src/components/pricing-page/pricing-header.astro index 06938bb4..215fd519 100644 --- a/src/components/pricing-page/pricing-header.astro +++ b/src/components/pricing-page/pricing-header.astro @@ -36,11 +36,6 @@ const pathname = Astro.url.pathname;
-

- Explore Pricing and Earnings on Akash -