From ca61f2337b79725240e4bfccbf9111b31c0f6263 Mon Sep 17 00:00:00 2001 From: Don Strawsburg Date: Fri, 13 Dec 2024 16:03:39 -0500 Subject: [PATCH] updated to use ProductTable Co-authored-by: sstrawsburg@gmail.com --- src/app/Products/grips/page.tsx | 2 ++ src/app/Products/handguards/page.tsx | 25 ++----------------- src/app/Products/stocks/page.tsx | 25 ++----------------- src/app/Products/triggers/page.tsx | 35 ++++++--------------------- src/app/Products/uppers/page.tsx | 25 ++----------------- src/components/ProductTable/index.tsx | 4 ++- 6 files changed, 18 insertions(+), 98 deletions(-) diff --git a/src/app/Products/grips/page.tsx b/src/app/Products/grips/page.tsx index 2e5f3bd..061f32e 100644 --- a/src/app/Products/grips/page.tsx +++ b/src/app/Products/grips/page.tsx @@ -3,6 +3,7 @@ import { psa } from '@db/schema/Psa'; import partTypes from 'src/data/parts_cats.json'; import styles from '../styles.module.css'; import PageHero from "@src/components/PageHero"; +import ProductTable from "@src/components/ProductTable"; export default async function GripsPage() { const psa = await getGrips(); @@ -11,6 +12,7 @@ export default async function GripsPage() {
+ diff --git a/src/app/Products/handguards/page.tsx b/src/app/Products/handguards/page.tsx index 9536fb2..a0b4b7e 100644 --- a/src/app/Products/handguards/page.tsx +++ b/src/app/Products/handguards/page.tsx @@ -3,6 +3,7 @@ import { psa } from '@db/schema/Psa'; import partTypes from 'src/data/parts_cats.json'; import styles from '../styles.module.css'; import PageHero from "@src/components/PageHero"; +import ProductTable from "@src/components/ProductTable"; export default async function HamdGuardsPage() { const psa = await getARHandGuards(); @@ -11,29 +12,7 @@ export default async function HamdGuardsPage() {
-
- - - - - - - - - - {psa.map((psa) => ( - - - - - - - ))} - -
ComponentManufacturerModel #Price
{psa.category}{psa.brandName}{psa.modelnumber} - ${Number(psa.salePrice).toFixed(2)} - -
+
); diff --git a/src/app/Products/stocks/page.tsx b/src/app/Products/stocks/page.tsx index 07e5a8f..5070f31 100644 --- a/src/app/Products/stocks/page.tsx +++ b/src/app/Products/stocks/page.tsx @@ -3,6 +3,7 @@ import { psa } from '@db/schema/Psa'; import partTypes from 'src/data/parts_cats.json'; import styles from '../styles.module.css'; import PageHero from "@src/components/PageHero"; +import ProductTable from "@src/components/ProductTable"; export default async function StocksPage() { const psa = await getStocks(); @@ -11,29 +12,7 @@ export default async function StocksPage() {
- - - - - - - - - - - {psa.map((psa) => ( - - - - - - - ))} - -
ComponentManufacturerModel #Price
{psa.category}{psa.brandName}{psa.modelnumber} - ${Number(psa.salePrice).toFixed(2)} - -
+
); diff --git a/src/app/Products/triggers/page.tsx b/src/app/Products/triggers/page.tsx index 66a724e..7230ead 100644 --- a/src/app/Products/triggers/page.tsx +++ b/src/app/Products/triggers/page.tsx @@ -1,40 +1,19 @@ -import { getARTriggers} from "@queries/PSA"; +import { getARTriggers } from "@queries/PSA"; import { psa } from '@db/schema/Psa'; import partTypes from 'src/data/parts_cats.json'; -import styles from '../styles.module.css'; +import styles from '../styles.module.css'; import PageHero from "@src/components/PageHero"; +import ProductTable from "@src/components/ProductTable"; export default async function TriggersPage() { const psa = await getARTriggers(); return (
- -
- - - - - - - - - - - {psa.map((psa) => ( - - - - - - - ))} - -
ComponentManufacturerModel #Price
{psa.category}{psa.brandName}{psa.modelnumber} - ${Number(psa.salePrice).toFixed(2)} - -
-
+ +
+ +
); } \ No newline at end of file diff --git a/src/app/Products/uppers/page.tsx b/src/app/Products/uppers/page.tsx index 399a8b1..fae63f2 100644 --- a/src/app/Products/uppers/page.tsx +++ b/src/app/Products/uppers/page.tsx @@ -2,6 +2,7 @@ import { getPSA, getUpperReciever } from "@queries/PSA"; import { psa } from '@db/schema/Psa'; import styles from '../styles.module.css'; import PageHero from "@src/components/PageHero"; +import ProductTable from "@src/components/ProductTable"; export default async function UpperReceiverPage() { const psa = await getUpperReciever(); @@ -10,29 +11,7 @@ export default async function UpperReceiverPage() {
- - - - - - - - - - - {psa.map((psa) => ( - - - - - - - ))} - -
ComponentManufacturerModel #Price
{psa.category}{psa.brandName}{psa.modelnumber} - ${Number(psa.salePrice).toFixed(2)} - -
+
); diff --git a/src/components/ProductTable/index.tsx b/src/components/ProductTable/index.tsx index b9d8ece..17b9f73 100644 --- a/src/components/ProductTable/index.tsx +++ b/src/components/ProductTable/index.tsx @@ -8,7 +8,8 @@ export default async function ProductTable(props:any) { Component Manufacturer Model # - Price + Retail Price + Sale Price @@ -17,6 +18,7 @@ export default async function ProductTable(props:any) { {item.category} {item.brandName} {item.modelnumber} + {item.retailPrice} ${Number(item.salePrice).toFixed(2)}