ok, we are nearly done

This commit is contained in:
2024-12-14 00:43:45 -05:00
parent 94e5886d70
commit 62f95b16cd
10 changed files with 187 additions and 174 deletions

View File

@@ -1,18 +1,17 @@
import { getPSA, getLowerBuildKits, getProductType } from "@queries/PSA";
import { psa } from '@db/schema/Psa';
import { getProductType } from "@queries/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 BarrelsPage() {
const psa = await getProductType('Barrels');
const data = await getProductType('Barrels');
return (
<div>
<PageHero title="Barrels" />
<div className="container mx-auto">
<ProductTable data={psa}></ProductTable>
<ProductTable data={data}></ProductTable>
</div>
</div>
);

View File

@@ -1,43 +1,17 @@
import { getPSA, getLowerBuildKits, getGrips } from "@queries/PSA";
import { psa } from '@db/schema/Psa';
import { getGrips } from "@queries/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();
const data = await getGrips();
return (
<div>
<PageHero title="AR Grips" />
<div className="container mx-auto">
<ProductTable data={psa}></ProductTable>
<table className="table-auto border-collapse border-spacing-3 border border-slate-500">
<thead>
<tr className={styles.tr}>
<th className='bg-slate-700 pl-2 w-40'>Component</th>
<th className='bg-slate-700 w-40'>Manufacturer</th>
<th className='bg-slate-700 w-40'>Model #</th>
<th className='bg-slate-700 w-20'>Retail Price</th>
<th className='bg-slate-700 w-20'>Sale Price</th>
</tr>
</thead>
<tbody>
{psa.map((psa) => (
<tr key={psa.upc}>
<td className='text-slate-800 pl-2'>{psa.category}</td>
<td className='text-slate-800'>{psa.brandName}</td>
<td className='text-slate-800'>{psa.modelnumber}</td>
<td className='text-slate-800'>{psa.retailPrice}</td>
<td className="text-slate-800 flex items-center gap-2">
${Number(psa.salePrice).toFixed(2)}
<button>Buy</button>
</td>
</tr>
))}
</tbody>
</table>
<ProductTable data={data}></ProductTable>
</div>
</div>
);

View File

@@ -1,18 +1,16 @@
import { getPSA, getLowerBuildKits, getARHandGuards } from "@queries/PSA";
import { psa } from '@db/schema/Psa';
import partTypes from 'src/data/parts_cats.json';
import { getARHandGuards } from "@queries/PSA";
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();
const data = await getARHandGuards();
return (
<div>
<PageHero title="Hand Guards" />
<div className="container mx-auto">
<ProductTable data={psa}></ProductTable>
<ProductTable data={data}></ProductTable>
</div>
</div>
);

View File

@@ -4,47 +4,16 @@ import { psa } from "@db/schema/Psa";
import styles from "../styles.module.css";
import PageHero from "@components/PageHero";
import Link from "next/link";
import ProductTable from "@src/components/ProductTable";
export default async function LowerReceiverPage() {
const psa = await getProductType(partTypes["AR COMPLETE LOWERS"]);
const data = await getProductType(partTypes["AR COMPLETE LOWERS"]);
return (
<div>
<PageHero title="Lowers" />
<PageHero title="Lowers"/>
<div className="container mx-auto py-5">
<table
className={
"table-auto border-separate border-spacing-4 border border-slate-500 text-gray-900"
}
>
<thead>
<tr >
<th>Component</th>
<th>Manufacturer</th>
<th>Model #</th>
<th>Price</th>
<th>Sale Price</th>
</tr>
</thead>
<tbody>
{psa.map((psa) => (
<tr key={psa.upc}>
<td>{psa.category}</td>
<td>{psa.brandName}</td>
<td>{psa.modelnumber}</td>
<td>{psa.retailPrice}</td>
<td className="flex items-center gap-2">
${Number(psa.salePrice).toFixed(2)}
{/* I dont think this is exactly correct but works for now? */}
<Link href={psa.buyLink} passHref={true}>
<button >Buy</button>
</Link>
</td>
</tr>
))}
</tbody>
</table>
<ProductTable data={data}></ProductTable>
</div>
</div>
);

View File

@@ -1,18 +1,17 @@
import { getMuzzleDevices } from "@queries/PSA";
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 MuzzleDevices() {
const psa = await getMuzzleDevices();
const data = await getMuzzleDevices();
return (
<div>
<PageHero title="Muzzle Devices" />
<div className="container mx-auto">
<ProductTable data={psa}></ProductTable>
<ProductTable data={data}></ProductTable>
</div>
</div>
);

View File

@@ -1,36 +1,14 @@
import { getPSA, getLowerBuildKits, getProductType} from "@queries/PSA";
import { psa } from '@db/schema/Psa';
import { getARParts } from "@queries/PSA";
import partTypes from 'src/data/parts_cats.json';
import styles from '../styles.module.css';
import styles from '../styles.module.css';
import ProductTable from "@src/components/ProductTable";
export default async function PartsPage() {
const psa = await getProductType(partTypes["AR PARTS"]);
const data = await getARParts();
return (
<div className="container mx-auto">
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
<thead>
<tr className={styles.tr}>
<th>Component</th>
<th>Manufacturer</th>
<th>Model #</th>
<th>Price</th>
</tr>
</thead>
<tbody>
{psa.map((psa) => (
<tr key={psa.upc}>
<td>{psa.category}</td>
<td>{psa.brandName}</td>
<td>{psa.modelnumber}</td>
<td className="flex items-center gap-2">
${Number(psa.salePrice).toFixed(2)}
<button >Buy</button>
</td>
</tr>
))}
</tbody>
</table>
<ProductTable data={data}></ProductTable>
</div>
);
}