new tailwindui table on bulder page

This commit is contained in:
2024-12-13 14:58:08 -05:00
parent c2a677e7e1
commit 01c0b22bc4
2 changed files with 106 additions and 42 deletions

View File

@@ -1,37 +1,106 @@
import { ChevronDownIcon } from "@heroicons/react/20/solid";
import { getPSA, getLowerBuildKits, getGrips } from "@queries/PSA";
import { psa } from "@db/schema/Psa";
import partTypes from "src/data/parts_cats.json";
export default async function BuilderPage() {
export default function BuilderPage() { const psa = await getGrips();
return ( return (
<div className="container mx-auto "> <div className="p-4 sm:p-6 lg:p-8">
<table className="table-auto border-separate border-spacing-2 border border-slate-500 text-gray-900"> <div className="sm:flex sm:items-center">
<thead> <div className="sm:flex-auto">
<tr> <h1 className="text-base font-semibold text-gray-900">Users</h1>
<th>Component</th> <p className="mt-2 text-sm text-gray-700">
<th>Selection</th> A list of all the Grips We Could Find{" "}
<th>Base Price</th> </p>
<th>Sale Price</th> </div>
<th>Shipping</th> </div>
<th>Tax</th> <div className="mt-8 flow-root">
<th>Total Price</th> <div className="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<th>Source</th> <div className="inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8">
<th>Order</th> <table className="min-w-full divide-y divide-gray-300">
</tr> <thead>
</thead> <tr>
<tbody> <th
<tr> scope="col"
<td>Part 1</td> className="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-0"
<td>Part</td> >
<td>99.99</td> <a href="#" className="group inline-flex">
<td>89.99</td> Component
<td>12.99</td> <span className="invisible ml-2 flex-none rounded text-gray-400 group-hover:visible group-focus:visible">
<td></td> <ChevronDownIcon
<td>Palmetto State</td> aria-hidden="true"
<td>101.99</td> className="size-5"
<td><button>Buy Item</button></td> />
</tr> </span>
</a>
</tbody> </th>
</table> <th
scope="col"
className="px-3 py-3.5 text-left text-sm font-semibold text-gray-900"
>
<a href="#" className="group inline-flex">
Manufacturer
<span className="ml-2 flex-none rounded bg-gray-100 text-gray-900 group-hover:bg-gray-200">
<ChevronDownIcon
aria-hidden="true"
className="size-5"
/>
</span>
</a>
</th>
<th
scope="col"
className="px-3 py-3.5 text-left text-sm font-semibold text-gray-900"
>
<a href="#" className="group inline-flex">
Price
<span className="invisible ml-2 flex-none rounded text-gray-400 group-hover:visible group-focus:visible">
<ChevronDownIcon
aria-hidden="true"
className="invisible ml-2 size-5 flex-none rounded text-gray-400 group-hover:visible group-focus:visible"
/>
</span>
</a>
</th>
<th
scope="col"
className="px-3 py-3.5 text-left text-sm font-semibold text-gray-900"
>
<a href="#" className="group inline-flex">
Purchase
<span className="invisible ml-2 flex-none rounded text-gray-400 group-hover:visible group-focus:visible">
<ChevronDownIcon
aria-hidden="true"
className="invisible ml-2 size-5 flex-none rounded text-gray-400 group-hover:visible group-focus:visible"
/>
</span>
</a>
</th>
</tr>
</thead>
<tbody className="divide-y divide-gray-200 bg-white">
{psa.map((psa) => (
<tr key={psa.upc}>
<td className="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-0">
{psa.productName}
</td>
<td className="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
{psa.brandName}
</td>
<td className="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
{psa.retailPrice}
</td>
<td className="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
{psa.salePrice}
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
</div> </div>
); );
} }

View File

@@ -1,14 +1,8 @@
import About from "@components/site/About";
import Contact from "@components/site/Contact";
import FeaturesSection from "@components/FeaturesSection";
import Footer from "@components/site/Footer";
import Header from "@components/Header";
import Hero from "@components/Hero";
import { ChevronRightIcon } from "@heroicons/react/24/outline";
export default async function Home() { export default async function Home() {
return ( return (
<div className="bg-white"> <div className="bg-white ">
<div className="relative isolate pt-1"> <div className="relative isolate pt-1">
<svg <svg
aria-hidden="true" aria-hidden="true"
@@ -46,10 +40,11 @@ export default async function Home() {
<div className="mt-10 flex items-top gap-x-6"> <div className="mt-10 flex items-top gap-x-6">
<a <a
href="#" href="#"
className="rounded-md bg-indigo-600 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600" className="up rounded-md bg-lime-800 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-lime-900 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
> >
Get started Get Building
</a> </a>
</div> </div>
</div> </div>
<div className="mt-16 sm:mt-24 alignlg:mt-0 lg:shrink-0 lg:grow items-top"> <div className="mt-16 sm:mt-24 alignlg:mt-0 lg:shrink-0 lg:grow items-top">