@@ -782,26 +914,30 @@ export default function Home() {
- {/* Table Footer */}
-
-
-
- Showing {sortedParts.length} of {products.length} parts
- {hasActiveFilters && (
-
- (filtered)
-
- )}
-
-
-
)}
+ {/* Pagination */}
+ {totalPages > 1 && (
+ {
+ setItemsPerPage(items);
+ setCurrentPage(1); // Reset to first page when changing items per page
+ }}
+ totalItems={sortedParts.length}
+ startIndex={startIndex}
+ endIndex={endIndex}
+ />
+ )}
+
{/* Card View */}
{viewMode === 'cards' && (
- {sortedParts.map((part) => (
+ {paginatedParts.map((part) => (
handleAdd(part)} added={addedPartIds.includes(part.id)} />
))}
diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx
index 71bf659..a84ca06 100644
--- a/src/components/Navbar.tsx
+++ b/src/components/Navbar.tsx
@@ -120,8 +120,10 @@ export default function Navbar() {
{session.user.email}
)}
- {menuItems.map((item, idx) =>
- item.custom ? (
+ {menuItems.map((item, idx) => {
+ if (!item) return null;
+
+ return item.custom ? (
Theme
{item.custom}
@@ -132,7 +134,7 @@ export default function Navbar() {
href={item.href}
className={`block px-4 py-2 text-sm rounded transition-colors ${
item.active
- ? 'bg-primary/10 text-primary font-semibold'
+ ? 'bg-blue-100 text-blue-700 font-semibold'
: 'text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-700'
}`}
onClick={item.onClick}
@@ -147,15 +149,15 @@ export default function Navbar() {
>
{item.label}
- )
- )}
+ );
+ })}
)}
>
) : (
signIn()}
>
Sign In
@@ -175,8 +177,8 @@ export default function Navbar() {
href={item.href}
className={`px-2 py-1 rounded-md text-sm font-medium transition-colors ${
pathname === item.href
- ? 'text-primary font-semibold underline underline-offset-4'
- : 'text-neutral-700 dark:text-neutral-200 hover:text-primary'
+ ? 'text-blue-600 font-semibold underline underline-offset-4'
+ : 'text-neutral-700 dark:text-neutral-200 hover:text-blue-600'
}`}
>
{item.label}
diff --git a/src/components/ProductCard.tsx b/src/components/ProductCard.tsx
index 105ba22..1e6f3c0 100644
--- a/src/components/ProductCard.tsx
+++ b/src/components/ProductCard.tsx
@@ -28,43 +28,43 @@ export default function ProductCard({ product, onAdd, added }: ProductCardProps)
const restrictionConfig = {
NFA: {
label: 'NFA',
- color: 'badge-error',
+ color: 'bg-red-100 text-red-800',
icon: 'π',
tooltip: 'National Firearms Act - Requires special registration'
},
SBR: {
label: 'SBR',
- color: 'badge-warning',
+ color: 'bg-yellow-100 text-yellow-800',
icon: 'π',
tooltip: 'Short Barrel Rifle - Requires NFA registration'
},
SUPPRESSOR: {
label: 'Suppressor',
- color: 'badge-secondary',
+ color: 'bg-gray-100 text-gray-800',
icon: 'π',
tooltip: 'Sound Suppressor - Requires NFA registration'
},
FFL_REQUIRED: {
label: 'FFL',
- color: 'badge-info',
+ color: 'bg-blue-100 text-blue-800',
icon: 'πͺ',
tooltip: 'Federal Firearms License required for purchase'
},
STATE_RESTRICTIONS: {
label: 'State',
- color: 'badge-warning',
+ color: 'bg-yellow-100 text-yellow-800',
icon: 'πΊοΈ',
tooltip: 'State-specific restrictions may apply'
},
HIGH_CAPACITY: {
label: 'High Cap',
- color: 'badge-accent',
+ color: 'bg-purple-100 text-purple-800',
icon: 'π₯',
tooltip: 'High capacity magazine - check local laws'
},
SILENCERSHOP_PARTNER: {
label: 'SilencerShop',
- color: 'badge-success',
+ color: 'bg-green-100 text-green-800',
icon: 'π€',
tooltip: 'Available through SilencerShop partnership'
}
@@ -75,7 +75,7 @@ export default function ProductCard({ product, onAdd, added }: ProductCardProps)
return (
{config.icon}
@@ -85,7 +85,7 @@ export default function ProductCard({ product, onAdd, added }: ProductCardProps)
};
return (
-
+
-
-
{product.name}
-
{product.description}
+
+
{product.name}
+
{product.description}
- {product.brand.name}
- ${lowestPrice.toFixed(2)}
+ {product.brand.name}
+ ${lowestPrice.toFixed(2)}