diff --git a/next.config.ts b/next.config.ts index e9ffa30..0904350 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,16 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - /* config options here */ + images: { + remotePatterns: [ + { + protocol: 'https', + hostname: 'placehold.co', + port: '', + pathname: '/**', + }, + ], + }, }; export default nextConfig; diff --git a/src/app/page.tsx b/src/app/page.tsx index 1bac4e7..57bb679 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -8,640 +8,23 @@ import SearchInput from '@/components/SearchInput'; import ProductCard from '@/components/ProductCard'; import RestrictionAlert from '@/components/RestrictionAlert'; import Tooltip from '@/components/Tooltip'; - -// Sample firearm parts data -const parts = [ - { - id: '1', - name: 'Faxon 16" Gunner Barrel - 5.56 NATO', - description: 'Lightweight, high-performance AR-15 barrel with 1:8 twist rate', - image_url: 'https://placehold.co/300x200/1f2937/ffffff?text=Barrel', - brand: { - id: 'b1', - name: 'Faxon Firearms', - }, - category: { - id: 'c1', - name: 'Barrel', - }, - restrictions: [], - offers: [ - { - price: 189.99, - url: 'https://primaryarms.com/faxon-16-gunner-barrel', - vendor: { - name: 'Primary Arms', - }, - }, - ], - }, - { - id: '2', - name: 'BCM M4 Upper Receiver', - description: 'Forged upper receiver with M4 feed ramps and T-markings', - image_url: 'https://placehold.co/300x200/374151/ffffff?text=Upper+Receiver', - brand: { - id: 'b2', - name: 'BCM', - }, - category: { - id: 'c2', - name: 'Upper Receiver', - }, - restrictions: [], - offers: [ - { - price: 129.99, - url: 'https://rainierarms.com/bcm-m4-upper', - vendor: { - name: 'Rainier Arms', - }, - }, - ], - }, - { - id: '3', - name: 'Aero Precision Lower Receiver', - description: 'Mil-spec forged lower receiver with trigger guard and threaded bolt catch', - image_url: 'https://placehold.co/300x200/4b5563/ffffff?text=Lower+Receiver', - brand: { - id: 'b3', - name: 'Aero Precision', - }, - category: { - id: 'c3', - name: 'Lower Receiver', - }, - restrictions: ['FFL_REQUIRED'], - offers: [ - { - price: 89.99, - url: 'https://aeroprecisionusa.com/lower', - vendor: { - name: 'Aero Precision', - }, - }, - ], - }, - { - id: '4', - name: 'Toolcraft BCG - Nitride', - description: 'Mil-spec bolt carrier group with Carpenter 158 bolt and nitride finish', - image_url: 'https://placehold.co/300x200/6b7280/ffffff?text=BCG', - brand: { - id: 'b4', - name: 'Toolcraft', - }, - category: { - id: 'c4', - name: 'BCG', - }, - restrictions: [], - offers: [ - { - price: 149.99, - url: 'https://wctoolcraft.com/bcg-nitride', - vendor: { - name: 'WC Toolcraft', - }, - }, - ], - }, - { - id: '5', - name: 'Geissele SSA-E Trigger', - description: 'Two-stage trigger with 3.5lb total pull weight and enhanced reliability', - image_url: 'https://placehold.co/300x200/1e40af/ffffff?text=Trigger', - brand: { - id: 'b5', - name: 'Geissele', - }, - category: { - id: 'c5', - name: 'Trigger', - }, - restrictions: [], - offers: [ - { - price: 249.99, - url: 'https://geissele.com/ssa-e', - vendor: { - name: 'Geissele', - }, - }, - ], - }, - { - id: '6', - name: 'Magpul CTR Stock', - description: 'Collapsible stock with friction lock system and QD sling mount', - image_url: 'https://placehold.co/300x200/059669/ffffff?text=Stock', - brand: { - id: 'b6', - name: 'Magpul', - }, - category: { - id: 'c6', - name: 'Stock', - }, - restrictions: [], - offers: [ - { - price: 69.99, - url: 'https://magpul.com/ctr-stock', - vendor: { - name: 'Magpul', - }, - }, - ], - }, - { - id: '7', - name: 'Radian Raptor Charging Handle', - description: 'Ambidextrous charging handle with oversized latches and smooth operation', - image_url: 'https://placehold.co/300x200/7c3aed/ffffff?text=Charging+Handle', - brand: { - id: 'b7', - name: 'Radian Weapons', - }, - category: { - id: 'c7', - name: 'Charging Handle', - }, - restrictions: [], - offers: [ - { - price: 89.99, - url: 'https://radianweapons.com/raptor', - vendor: { - name: 'Radian Weapons', - }, - }, - ], - }, - { - id: '8', - name: 'BCM Gunfighter Handguard - 15" M-LOK', - description: 'Free-float handguard with M-LOK slots and integrated QD mounts', - image_url: 'https://placehold.co/300x200/dc2626/ffffff?text=Handguard', - brand: { - id: 'b2', - name: 'BCM', - }, - category: { - id: 'c8', - name: 'Handguard', - }, - restrictions: [], - offers: [ - { - price: 199.99, - url: 'https://bravocompanyusa.com/handguard', - vendor: { - name: 'BCM', - }, - }, - ], - }, - { - id: '9', - name: 'SureFire WarComp Flash Hider', - description: 'Compensator/flash hider hybrid with suppressor mount capability', - image_url: 'https://placehold.co/300x200/ea580c/ffffff?text=Muzzle+Device', - brand: { - id: 'b8', - name: 'SureFire', - }, - category: { - id: 'c9', - name: 'Muzzle Device', - }, - restrictions: [], - offers: [ - { - price: 159.99, - url: 'https://surefire.com/warcomp', - vendor: { - name: 'SureFire', - }, - }, - ], - }, - { - id: '10', - name: 'Aero Precision Gas Block - Low Profile', - description: 'Low-profile adjustable gas block for free-float handguards', - image_url: 'https://placehold.co/300x200/be185d/ffffff?text=Gas+Block', - brand: { - id: 'b3', - name: 'Aero Precision', - }, - category: { - id: 'c10', - name: 'Gas Block', - }, - restrictions: [], - offers: [ - { - price: 49.99, - url: 'https://aeroprecisionusa.com/gas-block', - vendor: { - name: 'Aero Precision', - }, - }, - ], - }, - { - id: '11', - name: 'BCM Gas Tube - Mid Length', - description: 'Stainless steel gas tube for mid-length gas systems', - image_url: 'https://placehold.co/300x200/0891b2/ffffff?text=Gas+Tube', - brand: { - id: 'b2', - name: 'BCM', - }, - category: { - id: 'c11', - name: 'Gas Tube', - }, - restrictions: [], - offers: [ - { - price: 19.99, - url: 'https://bravocompanyusa.com/gas-tube', - vendor: { - name: 'BCM', - }, - }, - ], - }, - { - id: '12', - name: 'Magpul MOE Pistol Grip', - description: 'Ergonomic pistol grip with storage compartment and enhanced texture', - image_url: 'https://placehold.co/300x200/166534/ffffff?text=Pistol+Grip', - brand: { - id: 'b6', - name: 'Magpul', - }, - category: { - id: 'c12', - name: 'Pistol Grip', - }, - restrictions: [], - offers: [ - { - price: 24.99, - url: 'https://magpul.com/moe-grip', - vendor: { - name: 'Magpul', - }, - }, - ], - }, - { - id: '13', - name: 'BCM Buffer Tube - Mil-Spec', - description: 'Mil-spec buffer tube with proper castle nut and end plate', - image_url: 'https://placehold.co/300x200/92400e/ffffff?text=Buffer+Tube', - brand: { - id: 'b2', - name: 'BCM', - }, - category: { - id: 'c13', - name: 'Buffer Tube', - }, - restrictions: [], - offers: [ - { - price: 44.99, - url: 'https://bravocompanyusa.com/buffer-tube', - vendor: { - name: 'BCM', - }, - }, - ], - }, - { - id: '14', - name: 'H2 Buffer Weight', - description: 'Heavy buffer weight for improved recoil management', - image_url: 'https://placehold.co/300x200/7c2d12/ffffff?text=Buffer', - brand: { - id: 'b9', - name: 'Spikes Tactical', - }, - category: { - id: 'c14', - name: 'Buffer', - }, - restrictions: [], - offers: [ - { - price: 29.99, - url: 'https://spikestactical.com/h2-buffer', - vendor: { - name: 'Spikes Tactical', - }, - }, - ], - }, - { - id: '15', - name: 'Sprinco Blue Buffer Spring', - description: 'Enhanced buffer spring for improved reliability and reduced wear', - image_url: 'https://placehold.co/300x200/1e3a8a/ffffff?text=Buffer+Spring', - brand: { - id: 'b10', - name: 'Sprinco', - }, - category: { - id: 'c15', - name: 'Buffer Spring', - }, - restrictions: [], - offers: [ - { - price: 19.99, - url: 'https://sprinco.com/blue-spring', - vendor: { - name: 'Sprinco', - }, - }, - ], - }, - { - id: '16', - name: 'Magpul PMAG 30-Round Magazine', - description: '30-round polymer magazine with anti-tilt follower and dust cover', - image_url: 'https://placehold.co/300x200/065f46/ffffff?text=Magazine', - brand: { - id: 'b6', - name: 'Magpul', - }, - category: { - id: 'c16', - name: 'Magazine', - }, - restrictions: ['STATE_RESTRICTIONS'], - offers: [ - { - price: 14.99, - url: 'https://magpul.com/pmag', - vendor: { - name: 'Magpul', - }, - }, - ], - }, - { - id: '17', - name: 'Troy Industries BUIS - Folding', - description: 'Folding backup iron sights with micro-adjustable elevation', - image_url: 'https://placehold.co/300x200/581c87/ffffff?text=Sights', - brand: { - id: 'b11', - name: 'Troy Industries', - }, - category: { - id: 'c17', - name: 'Sights', - }, - restrictions: [], - offers: [ - { - price: 129.99, - url: 'https://troyind.com/buis', - vendor: { - name: 'Troy Industries', - }, - }, - ], - }, - { - id: '18', - name: 'Aero Precision Trigger Guard', - description: 'Enhanced trigger guard with oversized opening for gloved hands', - image_url: 'https://placehold.co/300x200/991b1b/ffffff?text=Trigger+Guard', - brand: { - id: 'b3', - name: 'Aero Precision', - }, - category: { - id: 'c18', - name: 'Trigger Guard', - }, - restrictions: [], - offers: [ - { - price: 12.99, - url: 'https://aeroprecisionusa.com/trigger-guard', - vendor: { - name: 'Aero Precision', - }, - }, - ], - }, - { - id: '19', - name: 'Larue MBT-2S Trigger', - description: 'Two-stage trigger with 4.5lb total pull weight and excellent value', - image_url: 'https://placehold.co/300x200/0c4a6e/ffffff?text=Trigger', - brand: { - id: 'b12', - name: 'LaRue Tactical', - }, - category: { - id: 'c5', - name: 'Trigger', - }, - restrictions: [], - offers: [ - { - price: 89.99, - url: 'https://laruetactical.com/mbt-2s', - vendor: { - name: 'LaRue Tactical', - }, - }, - ], - }, - { - id: '20', - name: 'Daniel Defense 18" Barrel - 5.56 NATO', - description: 'Cold hammer forged barrel with 1:7 twist rate for precision shooting', - image_url: 'https://placehold.co/300x200/1f2937/ffffff?text=Barrel', - brand: { - id: 'b13', - name: 'Daniel Defense', - }, - category: { - id: 'c1', - name: 'Barrel', - }, - restrictions: [], - offers: [ - { - price: 399.99, - url: 'https://danieldefense.com/18-barrel', - vendor: { - name: 'Daniel Defense', - }, - }, - ], - }, - { - id: '21', - name: 'BCM Complete Lower Receiver', - description: 'Complete lower receiver with BCM trigger, grip, and stock', - image_url: 'https://placehold.co/300x200/374151/ffffff?text=Lower+Receiver', - brand: { - id: 'b2', - name: 'BCM', - }, - category: { - id: 'c3', - name: 'Lower Receiver', - }, - restrictions: ['FFL_REQUIRED'], - offers: [ - { - price: 449.99, - url: 'https://bravocompanyusa.com/complete-lower', - vendor: { - name: 'BCM', - }, - }, - ], - }, - { - id: '22', - name: 'Aimpoint PRO Red Dot Sight', - description: '2 MOA red dot sight with 2x magnification and 40mm objective', - image_url: 'https://placehold.co/300x200/4b5563/ffffff?text=Red+Dot+Sight', - brand: { - id: 'b14', - name: 'Aimpoint', - }, - category: { - id: 'c17', - name: 'Sights', - }, - restrictions: [], - offers: [ - { - price: 449.99, - url: 'https://aimpoint.com/pro', - vendor: { - name: 'Aimpoint', - }, - }, - ], - }, - { - id: '23', - name: 'SilencerCo Omega 300 Suppressor', - description: 'Multi-caliber suppressor with quick-detach mount system', - image_url: 'https://placehold.co/300x200/7f1d1d/ffffff?text=Suppressor', - brand: { - id: 'b15', - name: 'SilencerCo', - }, - category: { - id: 'c19', - name: 'Suppressor', - }, - restrictions: ['NFA', 'SUPPRESSOR', 'SILENCERSHOP_PARTNER'], - offers: [ - { - price: 899.99, - url: 'https://silencershop.com/omega-300', - vendor: { - name: 'SilencerShop', - }, - }, - ], - }, - { - id: '24', - name: 'Daniel Defense 10.3" SBR Barrel', - description: 'Short barrel rifle barrel with 1:7 twist rate for SBR builds', - image_url: 'https://placehold.co/300x200/1e293b/ffffff?text=SBR+Barrel', - brand: { - id: 'b13', - name: 'Daniel Defense', - }, - category: { - id: 'c1', - name: 'Barrel', - }, - restrictions: ['NFA', 'SBR', 'FFL_REQUIRED'], - offers: [ - { - price: 299.99, - url: 'https://danieldefense.com/10-3-sbr-barrel', - vendor: { - name: 'Daniel Defense', - }, - }, - ], - }, - { - id: '25', - name: 'Dead Air Sandman-S Suppressor', - description: 'Rugged 30-caliber suppressor with E-Brake technology', - image_url: 'https://placehold.co/300x200/374151/ffffff?text=Suppressor', - brand: { - id: 'b16', - name: 'Dead Air', - }, - category: { - id: 'c19', - name: 'Suppressor', - }, - restrictions: ['NFA', 'SUPPRESSOR', 'SILENCERSHOP_PARTNER'], - offers: [ - { - price: 799.99, - url: 'https://silencershop.com/sandman-s', - vendor: { - name: 'SilencerShop', - }, - }, - ], - }, - { - id: '26', - name: 'Magpul 60-Round Drum Magazine', - description: 'High-capacity drum magazine for AR-15 platform', - image_url: 'https://placehold.co/300x200/065f46/ffffff?text=Drum+Mag', - brand: { - id: 'b6', - name: 'Magpul', - }, - category: { - id: 'c16', - name: 'Magazine', - }, - restrictions: ['STATE_RESTRICTIONS', 'HIGH_CAPACITY'], - offers: [ - { - price: 129.99, - url: 'https://magpul.com/drum-mag', - vendor: { - name: 'Magpul', - }, - }, - ], - } -]; +import Link from 'next/link'; +import { mockProducts } from '@/mock/product'; +import type { Product } from '@/mock/product'; // Extract unique values for dropdowns -const categories = ['All', ...Array.from(new Set(parts.map(part => part.category.name)))]; -const brands = ['All', ...Array.from(new Set(parts.map(part => part.brand.name)))]; -const vendors = ['All', ...Array.from(new Set(parts.flatMap(part => part.offers.map(offer => offer.vendor.name))))]; -const restrictions = [...new Set(parts.flatMap(part => part.restrictions))]; +const categories = ['All', ...Array.from(new Set(mockProducts.map(part => part.category.name)))]; +const brands = ['All', ...Array.from(new Set(mockProducts.map(part => part.brand.name)))]; +const vendors = ['All', ...Array.from(new Set(mockProducts.flatMap(part => part.offers.map(offer => offer.vendor.name))))]; + +// Restrictions for filter dropdown +const restrictionOptions = [ + '', + 'NFA', + 'SBR', + 'SUPPRESSOR', + 'STATE_RESTRICTIONS', +]; type SortField = 'name' | 'category' | 'price'; type SortDirection = 'asc' | 'desc'; @@ -800,7 +183,7 @@ export default function Home() { }, [searchParams]); // Filter parts based on selected criteria - const filteredParts = parts.filter(part => { + const filteredParts = mockProducts.filter(part => { const matchesCategory = selectedCategory === 'All' || part.category.name === selectedCategory; const matchesBrand = selectedBrand === 'All' || part.brand.name === selectedBrand; const matchesVendor = selectedVendor === 'All' || part.offers.some(offer => offer.vendor.name === selectedVendor); @@ -808,7 +191,16 @@ export default function Home() { part.name.toLowerCase().includes(searchTerm.toLowerCase()) || part.description.toLowerCase().includes(searchTerm.toLowerCase()) || part.brand.name.toLowerCase().includes(searchTerm.toLowerCase()); - const matchesRestriction = !selectedRestriction || part.restrictions.includes(selectedRestriction); + + // Restriction filter logic + let matchesRestriction = true; + if (selectedRestriction) { + if (selectedRestriction === 'NFA') matchesRestriction = !!part.restrictions?.nfa; + else if (selectedRestriction === 'SBR') matchesRestriction = !!part.restrictions?.sbr; + else if (selectedRestriction === 'SUPPRESSOR') matchesRestriction = !!part.restrictions?.suppressor; + else if (selectedRestriction === 'STATE_RESTRICTIONS') matchesRestriction = !!(part.restrictions?.stateRestrictions && part.restrictions.stateRestrictions.length > 0); + else matchesRestriction = false; + } // Price range filtering let matchesPrice = true; @@ -882,6 +274,16 @@ export default function Home() { const hasActiveFilters = selectedCategory !== 'All' || selectedBrand !== 'All' || selectedVendor !== 'All' || searchTerm || priceRange || selectedRestriction; + // RestrictionBadge for table view (show NFA/SBR/Suppressor/State) + const getRestrictionFlags = (restrictions?: Product['restrictions']) => { + const flags: string[] = []; + if (restrictions?.nfa) flags.push('NFA'); + if (restrictions?.sbr) flags.push('SBR'); + if (restrictions?.suppressor) flags.push('SUPPRESSOR'); + if (restrictions?.stateRestrictions && restrictions.stateRestrictions.length > 0) flags.push('STATE_RESTRICTIONS'); + return flags; + }; + return (
{/* Page Title */} @@ -1019,7 +421,7 @@ export default function Home() { label="Restriction" value={selectedRestriction} onChange={setSelectedRestriction} - options={['', ...restrictions]} + options={restrictionOptions} placeholder="All restrictions" /> @@ -1047,7 +449,7 @@ export default function Home() { {/* View Toggle and Results Count */}
- Showing {sortedParts.length} of {parts.length} parts + Showing {sortedParts.length} of {mockProducts.length} parts {hasActiveFilters && ( (filtered) @@ -1076,7 +478,7 @@ export default function Home() {
{/* Restriction Alert Example */} - {sortedParts.some(part => part.restrictions.includes('NFA')) && ( + {sortedParts.some(part => part.restrictions?.nfa) && (
- + + + View Details + + ))} @@ -1172,7 +576,7 @@ export default function Home() {
- Showing {sortedParts.length} of {parts.length} parts + Showing {sortedParts.length} of {mockProducts.length} parts {hasActiveFilters && ( (filtered) diff --git a/src/app/products/[id]/page.tsx b/src/app/products/[id]/page.tsx new file mode 100644 index 0000000..86aae04 --- /dev/null +++ b/src/app/products/[id]/page.tsx @@ -0,0 +1,334 @@ +'use client'; + +import { useState } from 'react'; +import { useParams } from 'next/navigation'; +import { mockProducts } from '@/mock/product'; +import RestrictionAlert from '@/components/RestrictionAlert'; +import { StarIcon } from '@heroicons/react/20/solid'; +import Image from 'next/image'; + +export default function ProductDetailsPage() { + const params = useParams(); + const productId = params.id as string; + + const product = mockProducts.find(p => p.id === productId); + const [selectedImageIndex, setSelectedImageIndex] = useState(0); + const [selectedOffer, setSelectedOffer] = useState(0); + + if (!product) { + return ( +
+
+ Product not found +
+
+ ); + } + + // Use images array if present, otherwise fallback to image_url + const allImages = product.images && product.images.length > 0 + ? product.images + : [product.image_url]; + const lowestPrice = Math.min(...product.offers.map(o => o.price)); + const highestPrice = Math.max(...product.offers.map(o => o.price)); + const averageRating = product.reviews + ? product.reviews.reduce((acc, review) => acc + review.rating, 0) / product.reviews.length + : 0; + + return ( +
+ {/* Breadcrumb */} +
+ +
+ + {/* Restriction Alert */} + {(product.restrictions?.nfa || product.restrictions?.sbr || product.restrictions?.suppressor) && ( + + )} + +
+ {/* Product Images */} +
+
+ {product.name} +
+ + {allImages.length > 1 && ( +
+ {allImages.map((image, index) => ( + + ))} +
+ )} +
+ + {/* Product Info */} +
+ {/* Brand & Category */} +
+ {product.brand.logo && ( + {product.brand.name} + )} +
+
+ {product.brand.name} +
+
+ {product.category.icon} + + {product.category.name} + +
+
+
+ + {/* Product Name */} +

+ {product.name} +

+ + {/* Price Range */} +
+
+ ${lowestPrice.toFixed(2)} +
+ {lowestPrice !== highestPrice && ( +
+ - ${highestPrice.toFixed(2)} +
+ )} +
+ from {product.offers.length} vendor{product.offers.length > 1 ? 's' : ''} +
+
+ + {/* Reviews */} + {product.reviews && product.reviews.length > 0 && ( +
+
+ {[1, 2, 3, 4, 5].map((star) => ( + + ))} +
+ + {averageRating.toFixed(1)} ({product.reviews.length} reviews) + +
+ )} + + {/* Description */} +
+

Description

+

+ {product.longDescription || product.description} +

+
+ + {/* Add to Build Button */} +
+ + +
+
+
+ + {/* Specifications */} + {product.specifications && ( +
+

Specifications

+
+
+
+ {product.specifications.weight && ( +
+ Weight: {product.specifications.weight} +
+ )} + {product.specifications.length && ( +
+ Length: {product.specifications.length} +
+ )} + {product.specifications.material && ( +
+ Material: {product.specifications.material} +
+ )} + {product.specifications.finish && ( +
+ Finish: {product.specifications.finish} +
+ )} + {product.specifications.caliber && ( +
+ Caliber: {product.specifications.caliber} +
+ )} + {product.specifications.compatibility && ( +
+ Compatibility: +
+ {product.specifications.compatibility.map((comp, index) => ( + {comp} + ))} +
+
+ )} +
+
+
+
+ )} + + {/* Vendor Offers */} +
+

Where to Buy

+
+ {product.offers.map((offer, index) => ( +
+
+
+
+ {offer.vendor.logo && ( + {offer.vendor.name} + )} +
+
{offer.vendor.name}
+ {offer.shipping && ( +
+ {offer.shipping} +
+ )} +
+
+
+
+
+ ${offer.price.toFixed(2)} +
+ {offer.inStock !== undefined && ( +
+ {offer.inStock ? 'In Stock' : 'Out of Stock'} +
+ )} +
+ + View Deal + +
+
+
+
+ ))} +
+
+ + {/* Reviews */} + {product.reviews && product.reviews.length > 0 && ( +
+

Customer Reviews

+
+ {product.reviews.map((review) => ( +
+
+
+
+ {[1, 2, 3, 4, 5].map((star) => ( + + ))} +
+
+ {new Date(review.date).toLocaleDateString()} +
+
+
{review.user}
+

{review.comment}

+
+
+ ))} +
+
+ )} + + {/* Compatibility */} + {product.compatibility && product.compatibility.length > 0 && ( +
+

Compatible Parts

+
+ {product.compatibility.map((part, index) => ( + {part} + ))} +
+
+ )} +
+ ); +} \ No newline at end of file diff --git a/src/app/products/page.tsx b/src/app/products/page.tsx index 808b7c6..1d3cc8f 100644 --- a/src/app/products/page.tsx +++ b/src/app/products/page.tsx @@ -1,6 +1,6 @@ 'use client'; -import { mockProducts } from '@/mock/products'; +import { mockProducts } from '@/mock/product'; export default function ProductsPage() { return ( diff --git a/src/components/ProductCard.tsx b/src/components/ProductCard.tsx index b1fcc40..1b380a8 100644 --- a/src/components/ProductCard.tsx +++ b/src/components/ProductCard.tsx @@ -1,18 +1,20 @@ 'use client'; import { useState } from 'react'; +import Link from 'next/link'; +import { Product } from '@/mock/product'; interface ProductCardProps { - product: { - id: string; - name: string; - description: string; - image_url: string; - brand: { name: string }; - category: { name: string }; - restrictions: string[]; - offers: Array<{ price: number; vendor: { name: string } }>; - }; + product: Product; +} + +function getRestrictionFlags(restrictions?: Product['restrictions']): string[] { + const flags: string[] = []; + if (restrictions?.nfa) flags.push('NFA'); + if (restrictions?.sbr) flags.push('SBR'); + if (restrictions?.suppressor) flags.push('SUPPRESSOR'); + if (restrictions?.stateRestrictions && restrictions.stateRestrictions.length > 0) flags.push('STATE_RESTRICTIONS'); + return flags; } export default function ProductCard({ product }: ProductCardProps) { @@ -89,9 +91,9 @@ export default function ProductCard({ product }: ProductCardProps) { className="w-full h-48 object-cover" onError={() => setImageError(true)} /> - {product.restrictions && product.restrictions.length > 0 && ( + {getRestrictionFlags(product.restrictions).length > 0 && (
- {product.restrictions.map((restriction) => ( + {getRestrictionFlags(product.restrictions).map((restriction) => ( ))}
@@ -109,9 +111,11 @@ export default function ProductCard({ product }: ProductCardProps) {
{product.category.name} - + + + View Details + +
diff --git a/src/mock/product.ts b/src/mock/product.ts index f03d3e0..3d0305b 100644 --- a/src/mock/product.ts +++ b/src/mock/product.ts @@ -1,48 +1,1207 @@ -export const mockProducts = [ - { - id: '1', - name: 'Faxon 16" Gunner Barrel - 5.56 NATO', - description: 'Lightweight, high-performance AR-15 barrel.', - image_url: 'https://via.placeholder.com/300x200?text=Barrel', - brand: { - id: 'b1', - name: 'Faxon Firearms', - }, - category: { - id: 'c1', - name: 'Barrel', - }, - offers: [ - { - price: 189.99, - url: 'https://primaryarms.com/faxon-16-gunner-barrel', - vendor: { - name: 'Primary Arms', - }, - }, - ], +export interface Product { + id: string; + name: string; + description: string; + longDescription?: string; + image_url: string; + images?: string[]; // Multiple product images + brand: { + id: string; + name: string; + logo?: string; + }; + category: { + id: string; + name: string; + icon?: string; + }; + specifications?: { + weight?: string; + length?: string; + material?: string; + finish?: string; + caliber?: string; + compatibility?: string[]; + }; + restrictions?: { + nfa?: boolean; + sbr?: boolean; + suppressor?: boolean; + stateRestrictions?: string[]; + }; + offers: Array<{ + price: number; + url: string; + vendor: { + name: string; + logo?: string; + }; + inStock?: boolean; + shipping?: string; + }>; + reviews?: Array<{ + id: string; + rating: number; + comment: string; + user: string; + date: string; + }>; + relatedProducts?: string[]; // Product IDs + compatibility?: string[]; // Compatible part types +} + +export const mockProducts: Product[] = [ + { + id: '1', + name: 'Faxon 16" Gunner Barrel - 5.56 NATO', + description: 'Lightweight, high-performance AR-15 barrel.', + longDescription: 'The Faxon 16" Gunner Profile barrel offers the perfect balance of weight and performance. The Gunner profile reduces weight while maintaining accuracy and heat dissipation. Features a 1:8 twist rate for optimal bullet stabilization with a wide range of ammunition.', + image_url: 'https://placehold.co/300x200/1f2937/ffffff?text=Barrel', + images: [ + 'https://placehold.co/600x400/1f2937/ffffff?text=Barrel+Front', + 'https://placehold.co/600x400/1f2937/ffffff?text=Barrel+Side', + 'https://placehold.co/600x400/1f2937/ffffff?text=Barrel+Chamber' + ], + brand: { + id: 'b1', + name: 'Faxon Firearms', + logo: 'https://placehold.co/100x50/1f2937/ffffff?text=Faxon' }, - { - id: '2', - name: 'BCM M4 Upper Receiver', - description: 'Forged upper with M4 feed ramps.', - image_url: 'https://via.placeholder.com/300x200?text=Upper', - brand: { - id: 'b2', - name: 'BCM', - }, - category: { - id: 'c2', - name: 'Upper Receiver', - }, - offers: [ - { - price: 129.99, - url: 'https://rainierarms.com/bcm-m4-upper', - vendor: { - name: 'Rainier Arms', - }, - }, - ], + category: { + id: 'c1', + name: 'Barrel', + icon: '๐Ÿ”ซ' }, - ]; \ No newline at end of file + specifications: { + weight: '1.5 lbs', + length: '16 inches', + material: '4150 Chrome Moly Steel', + finish: 'Nitride', + caliber: '5.56 NATO / .223 Remington', + compatibility: ['AR-15', 'M4', 'M16'] + }, + restrictions: { + nfa: false, + sbr: false, + suppressor: false, + stateRestrictions: [] + }, + offers: [ + { + price: 189.99, + url: 'https://primaryarms.com/faxon-16-gunner-barrel', + vendor: { + name: 'Primary Arms', + logo: 'https://placehold.co/80x40/1f2937/ffffff?text=PA' + }, + inStock: true, + shipping: 'Free shipping on orders over $150' + }, + { + price: 199.99, + url: 'https://brownells.com/faxon-16-gunner-barrel', + vendor: { + name: 'Brownells', + logo: 'https://placehold.co/80x40/1f2937/ffffff?text=Brownells' + }, + inStock: true, + shipping: '$9.99 flat rate' + } + ], + reviews: [ + { + id: 'r1', + rating: 5, + comment: 'Excellent barrel! Lightweight and accurate. Perfect for my lightweight build.', + user: 'AR_Builder_2023', + date: '2024-01-15' + }, + { + id: 'r2', + rating: 4, + comment: 'Great quality, good accuracy. Only complaint is the finish could be more durable.', + user: 'GunGuy99', + date: '2024-01-10' + } + ], + relatedProducts: ['2', '3', '4'], + compatibility: ['Upper Receiver', 'Gas Block', 'Gas Tube', 'Muzzle Device'] + }, + { + id: '2', + name: 'BCM M4 Upper Receiver', + description: 'Forged upper with M4 feed ramps.', + longDescription: 'The BCM M4 Upper Receiver is forged from 7075-T6 aluminum and features M4 feed ramps for reliable feeding. Includes forward assist and dust cover. Mil-spec design ensures compatibility with standard AR-15 parts.', + image_url: 'https://placehold.co/300x200/1f2937/ffffff?text=Upper', + images: [ + 'https://placehold.co/600x400/1f2937/ffffff?text=Upper+Left', + 'https://placehold.co/600x400/1f2937/ffffff?text=Upper+Right', + 'https://placehold.co/600x400/1f2937/ffffff?text=Upper+Inside' + ], + brand: { + id: 'b2', + name: 'BCM', + logo: 'https://placehold.co/100x50/1f2937/ffffff?text=BCM' + }, + category: { + id: 'c2', + name: 'Upper Receiver', + icon: '๐Ÿ”ง' + }, + specifications: { + weight: '0.8 lbs', + material: '7075-T6 Aluminum', + finish: 'Type III Hardcoat Anodized', + compatibility: ['AR-15', 'M4', 'M16'] + }, + restrictions: { + nfa: false, + sbr: false, + suppressor: false, + stateRestrictions: [] + }, + offers: [ + { + price: 129.99, + url: 'https://rainierarms.com/bcm-m4-upper', + vendor: { + name: 'Rainier Arms', + logo: 'https://placehold.co/80x40/1f2937/ffffff?text=Rainier' + }, + inStock: true, + shipping: 'Free shipping' + } + ], + reviews: [ + { + id: 'r3', + rating: 5, + comment: 'BCM quality is unmatched. Perfect fit and finish.', + user: 'TacticalTom', + date: '2024-01-20' + } + ], + relatedProducts: ['1', '5', '6'], + compatibility: ['Barrel', 'Handguard', 'BCG', 'Charging Handle'] + }, + { + id: '3', + name: 'SilencerCo Omega 300 Suppressor', + description: 'Multi-caliber rifle suppressor with excellent sound reduction.', + longDescription: 'The SilencerCo Omega 300 is a versatile, lightweight suppressor designed for multiple calibers including .308, .300 Win Mag, and .223. Features a titanium tube with stainless steel baffles for durability and performance.', + image_url: 'https://placehold.co/300x200/1f2937/ffffff?text=Suppressor', + images: [ + 'https://placehold.co/600x400/1f2937/ffffff?text=Suppressor+Front', + 'https://placehold.co/600x400/1f2937/ffffff?text=Suppressor+Side' + ], + brand: { + id: 'b3', + name: 'SilencerCo', + logo: 'https://placehold.co/100x50/1f2937/ffffff?text=SilencerCo' + }, + category: { + id: 'c3', + name: 'Suppressor', + icon: '๐Ÿ”‡' + }, + specifications: { + weight: '14.4 oz', + length: '7.2 inches', + material: 'Titanium / Stainless Steel', + finish: 'Cerakote', + caliber: '.308, .300 Win Mag, .223, 6.5 Creedmoor' + }, + restrictions: { + nfa: true, + sbr: false, + suppressor: true, + stateRestrictions: ['CA', 'NY', 'IL', 'HI'] + }, + offers: [ + { + price: 899.99, + url: 'https://silencershop.com/omega-300', + vendor: { + name: 'Silencer Shop', + logo: 'https://placehold.co/80x40/1f2937/ffffff?text=SS' + }, + inStock: true, + shipping: 'Free shipping + tax stamp included' + } + ], + reviews: [ + { + id: 'r4', + rating: 5, + comment: 'Amazing sound reduction and build quality. Worth the wait for the tax stamp!', + user: 'SuppressedLife', + date: '2024-01-05' + } + ], + relatedProducts: ['7', '8'], + compatibility: ['Barrel', 'Muzzle Device', 'Mounting System'] + }, + { + id: '4', + name: 'Geissele SSA-E Trigger', + description: 'Two-stage trigger with 3.5lb total pull weight and enhanced reliability.', + longDescription: 'The Geissele SSA-E trigger is designed for precision and reliability, offering a crisp break and short reset. Ideal for both competition and duty use.', + image_url: 'https://placehold.co/300x200/1f2937/ffffff?text=Trigger', + images: [ + 'https://placehold.co/600x400/1f2937/ffffff?text=Trigger+Front', + 'https://placehold.co/600x400/1f2937/ffffff?text=Trigger+Side' + ], + brand: { + id: 'b4', + name: 'Geissele', + logo: 'https://placehold.co/100x50/1f2937/ffffff?text=Geissele' + }, + category: { + id: 'c4', + name: 'Trigger', + icon: '๐Ÿ”ซ' + }, + specifications: { + weight: '2.6 oz', + material: 'Steel', + finish: 'Nickel Boron', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 249.99, + url: 'https://geissele.com/ssa-e', + vendor: { + name: 'Geissele', + logo: 'https://placehold.co/80x40/1f2937/ffffff?text=Geissele' + }, + inStock: true, + shipping: 'Free shipping' + } + ], + reviews: [ + { + id: 'r5', + rating: 5, + comment: 'Best trigger I have ever used!', + user: 'TriggerFan', + date: '2024-02-01' + } + ], + relatedProducts: ['1', '2'], + compatibility: ['Lower Receiver'] + }, + { + id: '5', + name: 'Magpul PMAG 30-Round Magazine', + description: '30-round polymer magazine with anti-tilt follower and dust cover.', + longDescription: 'The Magpul PMAG is the industry standard for AR-15 magazines, offering reliability and durability in all conditions.', + image_url: 'https://placehold.co/300x200/1f2937/ffffff?text=Magazine', + images: [ + 'https://placehold.co/600x400/1f2937/ffffff?text=Magazine+Front', + 'https://placehold.co/600x400/1f2937/ffffff?text=Magazine+Side' + ], + brand: { + id: 'b5', + name: 'Magpul', + logo: 'https://placehold.co/100x50/1f2937/ffffff?text=Magpul' + }, + category: { + id: 'c5', + name: 'Magazine', + icon: '๐Ÿฅ' + }, + specifications: { + weight: '4.5 oz', + material: 'Polymer', + compatibility: ['AR-15'] + }, + restrictions: { + stateRestrictions: ['CA', 'NY', 'NJ', 'MA'] + }, + offers: [ + { + price: 14.99, + url: 'https://magpul.com/pmag', + vendor: { + name: 'Magpul', + logo: 'https://placehold.co/80x40/1f2937/ffffff?text=Magpul' + }, + inStock: true, + shipping: 'Flat rate $5' + } + ], + reviews: [ + { + id: 'r6', + rating: 5, + comment: 'Runs flawlessly in my AR.', + user: 'MagFan', + date: '2024-02-10' + } + ], + relatedProducts: ['6'], + compatibility: ['Lower Receiver'] + }, + { + id: '6', + name: 'BCM Gunfighter Stock', + description: 'Lightweight, durable stock with QD sling mount.', + longDescription: 'The BCM Gunfighter Stock is designed for comfort and durability, featuring a snag-free design and multiple sling attachment points.', + image_url: 'https://placehold.co/300x200/1f2937/ffffff?text=Stock', + images: [ + 'https://placehold.co/600x400/1f2937/ffffff?text=Stock+Front', + 'https://placehold.co/600x400/1f2937/ffffff?text=Stock+Side' + ], + brand: { + id: 'b2', + name: 'BCM', + logo: 'https://placehold.co/100x50/1f2937/ffffff?text=BCM' + }, + category: { + id: 'c6', + name: 'Stock', + icon: '๐Ÿช‘' + }, + specifications: { + weight: '7.5 oz', + material: 'Polymer', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 59.99, + url: 'https://bravocompanyusa.com/gunfighter-stock', + vendor: { + name: 'BCM', + logo: 'https://placehold.co/80x40/1f2937/ffffff?text=BCM' + }, + inStock: true, + shipping: 'Free shipping on orders over $100' + } + ], + reviews: [], + relatedProducts: ['5'], + compatibility: ['Buffer Tube'] + }, + { + id: '7', + name: 'Aero Precision Lower Receiver', + description: 'Mil-spec forged lower receiver with trigger guard and threaded bolt catch.', + longDescription: 'Aero Precision lowers are known for their tight tolerances and high quality. Perfect for any AR-15 build.', + image_url: 'https://placehold.co/300x200/1f2937/ffffff?text=Lower+Receiver', + images: [ + 'https://placehold.co/600x400/1f2937/ffffff?text=Lower+Receiver+Front', + 'https://placehold.co/600x400/1f2937/ffffff?text=Lower+Receiver+Side' + ], + brand: { + id: 'b3', + name: 'Aero Precision', + logo: 'https://placehold.co/100x50/1f2937/ffffff?text=Aero' + }, + category: { + id: 'c7', + name: 'Lower Receiver', + icon: '๐Ÿงฉ' + }, + specifications: { + weight: '8.5 oz', + material: '7075-T6 Aluminum', + finish: 'Type III Hardcoat Anodized', + compatibility: ['AR-15'] + }, + restrictions: {}, + offers: [ + { + price: 89.99, + url: 'https://aeroprecisionusa.com/lower', + vendor: { + name: 'Aero Precision', + logo: 'https://placehold.co/80x40.png?text=Aero' + }, + inStock: true, + shipping: 'Free shipping' + } + ], + reviews: [], + relatedProducts: ['1', '2', '3'], + compatibility: ['Trigger', 'Magazine'] + }, + { + id: '8', + name: 'Radian Raptor Charging Handle', + description: 'Ambidextrous charging handle with oversized latches and smooth operation.', + longDescription: 'The Radian Raptor is a premium ambidextrous charging handle designed for fast, fluid operation from either side of the rifle.', + image_url: 'https://placehold.co/300x200.png?text=Charging+Handle', + images: [ + 'https://placehold.co/600x400.png?text=Charging+Handle+Front', + 'https://placehold.co/600x400.png?text=Charging+Handle+Side' + ], + brand: { + id: 'b6', + name: 'Radian Weapons', + logo: 'https://placehold.co/100x50.png?text=Radian' + }, + category: { + id: 'c8', + name: 'Charging Handle', + icon: '๐Ÿ”ง' + }, + specifications: { + weight: '1.3 oz', + material: '7075-T6 Aluminum', + finish: 'Type III Hardcoat Anodized', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 89.99, + url: 'https://radianweapons.com/raptor', + vendor: { + name: 'Radian Weapons', + logo: 'https://placehold.co/80x40.png?text=Radian' + }, + inStock: true, + shipping: 'Free shipping' + } + ], + reviews: [ + { + id: 'r7', + rating: 5, + comment: 'Smoothest charging handle I have used.', + user: 'LeftyShooter', + date: '2024-02-15' + } + ], + relatedProducts: ['2', '7'], + compatibility: ['Upper Receiver'] + }, + { + id: '9', + name: 'SureFire WarComp Flash Hider', + description: 'Compensator/flash hider hybrid with suppressor mount capability.', + longDescription: 'The SureFire WarComp provides excellent flash reduction and muzzle control, and is compatible with SureFire suppressors.', + image_url: 'https://placehold.co/300x200.png?text=Muzzle+Device', + images: [ + 'https://placehold.co/600x400.png?text=Muzzle+Device+Front', + 'https://placehold.co/600x400.png?text=Muzzle+Device+Side' + ], + brand: { + id: 'b7', + name: 'SureFire', + logo: 'https://placehold.co/100x50.png?text=SureFire' + }, + category: { + id: 'c9', + name: 'Muzzle Device', + icon: '๐Ÿ’ฅ' + }, + specifications: { + weight: '2.7 oz', + material: 'Stainless Steel', + finish: 'Black Oxide', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 159.99, + url: 'https://surefire.com/warcomp', + vendor: { + name: 'SureFire', + logo: 'https://placehold.co/80x40.png?text=SureFire' + }, + inStock: true, + shipping: 'Free shipping' + } + ], + reviews: [], + relatedProducts: ['3'], + compatibility: ['Barrel', 'Suppressor'] + }, + { + id: '10', + name: 'Toolcraft BCG - Nitride', + description: 'Mil-spec bolt carrier group with Carpenter 158 bolt and nitride finish.', + longDescription: 'Toolcraft BCGs are trusted by professionals for their reliability and durability. Nitride finish for easy cleaning and corrosion resistance.', + image_url: 'https://placehold.co/300x200.png?text=BCG', + images: [ + 'https://placehold.co/600x400.png?text=BCG+Front', + 'https://placehold.co/600x400.png?text=BCG+Side' + ], + brand: { + id: 'b8', + name: 'Toolcraft', + logo: 'https://placehold.co/100x50.png?text=Toolcraft' + }, + category: { + id: 'c10', + name: 'BCG', + icon: '๐Ÿ”ฉ' + }, + specifications: { + weight: '11.5 oz', + material: '8620 Steel', + finish: 'Nitride', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 149.99, + url: 'https://wctoolcraft.com/bcg-nitride', + vendor: { + name: 'WC Toolcraft', + logo: 'https://placehold.co/80x40.png?text=Toolcraft' + }, + inStock: true, + shipping: 'Free shipping' + } + ], + reviews: [], + relatedProducts: ['2', '7'], + compatibility: ['Upper Receiver', 'Barrel'] + }, + { + id: '11', + name: 'Aero Precision Gas Block - Low Profile', + description: 'Low-profile adjustable gas block for free-float handguards.', + longDescription: 'Aero Precision gas blocks are machined to tight tolerances and are perfect for custom AR builds.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Block', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Block+Front', + 'https://placehold.co/600x400.png?text=Gas+Block+Side' + ], + brand: { + id: 'b3', + name: 'Aero Precision', + logo: 'https://placehold.co/100x50.png?text=Aero' + }, + category: { + id: 'c11', + name: 'Gas Block', + icon: '๐Ÿ›‘' + }, + specifications: { + weight: '1.1 oz', + material: 'Steel', + finish: 'Phosphate', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 49.99, + url: 'https://aeroprecisionusa.com/gas-block', + vendor: { + name: 'Aero Precision', + logo: 'https://placehold.co/80x40.png?text=Aero' + }, + inStock: true, + shipping: 'Flat rate $7' + } + ], + reviews: [], + relatedProducts: ['1', '2'], + compatibility: ['Barrel', 'Handguard'] + }, + { + id: '12', + name: 'BCM Gas Tube - Mid Length', + description: 'Stainless steel gas tube for mid-length gas systems.', + longDescription: 'BCM gas tubes are made from high-quality stainless steel and are compatible with most AR-15 barrels.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Tube', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Tube+Front', + 'https://placehold.co/600x400.png?text=Gas+Tube+Side' + ], + brand: { + id: 'b2', + name: 'BCM', + logo: 'https://placehold.co/100x50.png?text=BCM' + }, + category: { + id: 'c12', + name: 'Gas Tube', + icon: '๐Ÿงช' + }, + specifications: { + weight: '0.7 oz', + material: 'Stainless Steel', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 19.99, + url: 'https://bravocompanyusa.com/gas-tube', + vendor: { + name: 'BCM', + logo: 'https://placehold.co/80x40.png?text=BCM' + }, + inStock: true, + shipping: 'Flat rate $5' + } + ], + reviews: [], + relatedProducts: ['11'], + compatibility: ['Gas Block'] + }, + { + id: '13', + name: 'Aero Precision Gas Block - High Profile', + description: 'High-profile adjustable gas block for free-float handguards.', + longDescription: 'Aero Precision gas blocks are machined to tight tolerances and are perfect for custom AR builds.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Block', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Block+Front', + 'https://placehold.co/600x400.png?text=Gas+Block+Side' + ], + brand: { + id: 'b3', + name: 'Aero Precision', + logo: 'https://placehold.co/100x50.png?text=Aero' + }, + category: { + id: 'c13', + name: 'Gas Block', + icon: '๐Ÿ›‘' + }, + specifications: { + weight: '1.2 oz', + material: 'Steel', + finish: 'Phosphate', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 59.99, + url: 'https://aeroprecisionusa.com/gas-block', + vendor: { + name: 'Aero Precision', + logo: 'https://placehold.co/80x40.png?text=Aero' + }, + inStock: true, + shipping: 'Flat rate $7' + } + ], + reviews: [], + relatedProducts: ['1', '2'], + compatibility: ['Barrel', 'Handguard'] + }, + { + id: '14', + name: 'BCM Gas Tube - Full Length', + description: 'Stainless steel gas tube for full-length gas systems.', + longDescription: 'BCM gas tubes are made from high-quality stainless steel and are compatible with most AR-15 barrels.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Tube', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Tube+Front', + 'https://placehold.co/600x400.png?text=Gas+Tube+Side' + ], + brand: { + id: 'b2', + name: 'BCM', + logo: 'https://placehold.co/100x50.png?text=BCM' + }, + category: { + id: 'c14', + name: 'Gas Tube', + icon: '๐Ÿงช' + }, + specifications: { + weight: '0.8 oz', + material: 'Stainless Steel', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 29.99, + url: 'https://bravocompanyusa.com/gas-tube', + vendor: { + name: 'BCM', + logo: 'https://placehold.co/80x40.png?text=BCM' + }, + inStock: true, + shipping: 'Flat rate $5' + } + ], + reviews: [], + relatedProducts: ['13'], + compatibility: ['Gas Block'] + }, + { + id: '15', + name: 'Aero Precision Gas Block - Low Profile', + description: 'Low-profile adjustable gas block for free-float handguards.', + longDescription: 'Aero Precision gas blocks are machined to tight tolerances and are perfect for custom AR builds.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Block', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Block+Front', + 'https://placehold.co/600x400.png?text=Gas+Block+Side' + ], + brand: { + id: 'b3', + name: 'Aero Precision', + logo: 'https://placehold.co/100x50.png?text=Aero' + }, + category: { + id: 'c15', + name: 'Gas Block', + icon: '๐Ÿ›‘' + }, + specifications: { + weight: '1.1 oz', + material: 'Steel', + finish: 'Phosphate', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 49.99, + url: 'https://aeroprecisionusa.com/gas-block', + vendor: { + name: 'Aero Precision', + logo: 'https://placehold.co/80x40.png?text=Aero' + }, + inStock: true, + shipping: 'Flat rate $7' + } + ], + reviews: [], + relatedProducts: ['1', '2'], + compatibility: ['Barrel', 'Handguard'] + }, + { + id: '16', + name: 'BCM Gas Tube - Mid Length', + description: 'Stainless steel gas tube for mid-length gas systems.', + longDescription: 'BCM gas tubes are made from high-quality stainless steel and are compatible with most AR-15 barrels.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Tube', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Tube+Front', + 'https://placehold.co/600x400.png?text=Gas+Tube+Side' + ], + brand: { + id: 'b2', + name: 'BCM', + logo: 'https://placehold.co/100x50.png?text=BCM' + }, + category: { + id: 'c16', + name: 'Gas Tube', + icon: '๐Ÿงช' + }, + specifications: { + weight: '0.7 oz', + material: 'Stainless Steel', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 19.99, + url: 'https://bravocompanyusa.com/gas-tube', + vendor: { + name: 'BCM', + logo: 'https://placehold.co/80x40.png?text=BCM' + }, + inStock: true, + shipping: 'Flat rate $5' + } + ], + reviews: [], + relatedProducts: ['15'], + compatibility: ['Gas Block'] + }, + { + id: '17', + name: 'Aero Precision Gas Block - High Profile', + description: 'High-profile adjustable gas block for free-float handguards.', + longDescription: 'Aero Precision gas blocks are machined to tight tolerances and are perfect for custom AR builds.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Block', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Block+Front', + 'https://placehold.co/600x400.png?text=Gas+Block+Side' + ], + brand: { + id: 'b3', + name: 'Aero Precision', + logo: 'https://placehold.co/100x50.png?text=Aero' + }, + category: { + id: 'c17', + name: 'Gas Block', + icon: '๐Ÿ›‘' + }, + specifications: { + weight: '1.2 oz', + material: 'Steel', + finish: 'Phosphate', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 59.99, + url: 'https://aeroprecisionusa.com/gas-block', + vendor: { + name: 'Aero Precision', + logo: 'https://placehold.co/80x40.png?text=Aero' + }, + inStock: true, + shipping: 'Flat rate $7' + } + ], + reviews: [], + relatedProducts: ['1', '2'], + compatibility: ['Barrel', 'Handguard'] + }, + { + id: '18', + name: 'BCM Gas Tube - Full Length', + description: 'Stainless steel gas tube for full-length gas systems.', + longDescription: 'BCM gas tubes are made from high-quality stainless steel and are compatible with most AR-15 barrels.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Tube', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Tube+Front', + 'https://placehold.co/600x400.png?text=Gas+Tube+Side' + ], + brand: { + id: 'b2', + name: 'BCM', + logo: 'https://placehold.co/100x50.png?text=BCM' + }, + category: { + id: 'c18', + name: 'Gas Tube', + icon: '๐Ÿงช' + }, + specifications: { + weight: '0.8 oz', + material: 'Stainless Steel', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 29.99, + url: 'https://bravocompanyusa.com/gas-tube', + vendor: { + name: 'BCM', + logo: 'https://placehold.co/80x40.png?text=BCM' + }, + inStock: true, + shipping: 'Flat rate $5' + } + ], + reviews: [], + relatedProducts: ['17'], + compatibility: ['Gas Block'] + }, + { + id: '19', + name: 'Aero Precision Gas Block - Low Profile', + description: 'Low-profile adjustable gas block for free-float handguards.', + longDescription: 'Aero Precision gas blocks are machined to tight tolerances and are perfect for custom AR builds.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Block', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Block+Front', + 'https://placehold.co/600x400.png?text=Gas+Block+Side' + ], + brand: { + id: 'b3', + name: 'Aero Precision', + logo: 'https://placehold.co/100x50.png?text=Aero' + }, + category: { + id: 'c19', + name: 'Gas Block', + icon: '๐Ÿ›‘' + }, + specifications: { + weight: '1.1 oz', + material: 'Steel', + finish: 'Phosphate', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 49.99, + url: 'https://aeroprecisionusa.com/gas-block', + vendor: { + name: 'Aero Precision', + logo: 'https://placehold.co/80x40.png?text=Aero' + }, + inStock: true, + shipping: 'Flat rate $7' + } + ], + reviews: [], + relatedProducts: ['1', '2'], + compatibility: ['Barrel', 'Handguard'] + }, + { + id: '20', + name: 'BCM Gas Tube - Mid Length', + description: 'Stainless steel gas tube for mid-length gas systems.', + longDescription: 'BCM gas tubes are made from high-quality stainless steel and are compatible with most AR-15 barrels.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Tube', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Tube+Front', + 'https://placehold.co/600x400.png?text=Gas+Tube+Side' + ], + brand: { + id: 'b2', + name: 'BCM', + logo: 'https://placehold.co/100x50.png?text=BCM' + }, + category: { + id: 'c20', + name: 'Gas Tube', + icon: '๐Ÿงช' + }, + specifications: { + weight: '0.7 oz', + material: 'Stainless Steel', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 19.99, + url: 'https://bravocompanyusa.com/gas-tube', + vendor: { + name: 'BCM', + logo: 'https://placehold.co/80x40.png?text=BCM' + }, + inStock: true, + shipping: 'Flat rate $5' + } + ], + reviews: [], + relatedProducts: ['19'], + compatibility: ['Gas Block'] + }, + { + id: '21', + name: 'Aero Precision Gas Block - High Profile', + description: 'High-profile adjustable gas block for free-float handguards.', + longDescription: 'Aero Precision gas blocks are machined to tight tolerances and are perfect for custom AR builds.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Block', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Block+Front', + 'https://placehold.co/600x400.png?text=Gas+Block+Side' + ], + brand: { + id: 'b3', + name: 'Aero Precision', + logo: 'https://placehold.co/100x50.png?text=Aero' + }, + category: { + id: 'c21', + name: 'Gas Block', + icon: '๐Ÿ›‘' + }, + specifications: { + weight: '1.2 oz', + material: 'Steel', + finish: 'Phosphate', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 59.99, + url: 'https://aeroprecisionusa.com/gas-block', + vendor: { + name: 'Aero Precision', + logo: 'https://placehold.co/80x40.png?text=Aero' + }, + inStock: true, + shipping: 'Flat rate $7' + } + ], + reviews: [], + relatedProducts: ['1', '2'], + compatibility: ['Barrel', 'Handguard'] + }, + { + id: '22', + name: 'BCM Gas Tube - Full Length', + description: 'Stainless steel gas tube for full-length gas systems.', + longDescription: 'BCM gas tubes are made from high-quality stainless steel and are compatible with most AR-15 barrels.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Tube', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Tube+Front', + 'https://placehold.co/600x400.png?text=Gas+Tube+Side' + ], + brand: { + id: 'b2', + name: 'BCM', + logo: 'https://placehold.co/100x50.png?text=BCM' + }, + category: { + id: 'c22', + name: 'Gas Tube', + icon: '๐Ÿงช' + }, + specifications: { + weight: '0.8 oz', + material: 'Stainless Steel', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 29.99, + url: 'https://bravocompanyusa.com/gas-tube', + vendor: { + name: 'BCM', + logo: 'https://placehold.co/80x40.png?text=BCM' + }, + inStock: true, + shipping: 'Flat rate $5' + } + ], + reviews: [], + relatedProducts: ['21'], + compatibility: ['Gas Block'] + }, + { + id: '23', + name: 'Aero Precision Gas Block - Low Profile', + description: 'Low-profile adjustable gas block for free-float handguards.', + longDescription: 'Aero Precision gas blocks are machined to tight tolerances and are perfect for custom AR builds.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Block', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Block+Front', + 'https://placehold.co/600x400.png?text=Gas+Block+Side' + ], + brand: { + id: 'b3', + name: 'Aero Precision', + logo: 'https://placehold.co/100x50.png?text=Aero' + }, + category: { + id: 'c23', + name: 'Gas Block', + icon: '๐Ÿ›‘' + }, + specifications: { + weight: '1.1 oz', + material: 'Steel', + finish: 'Phosphate', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 49.99, + url: 'https://aeroprecisionusa.com/gas-block', + vendor: { + name: 'Aero Precision', + logo: 'https://placehold.co/80x40.png?text=Aero' + }, + inStock: true, + shipping: 'Flat rate $7' + } + ], + reviews: [], + relatedProducts: ['1', '2'], + compatibility: ['Barrel', 'Handguard'] + }, + { + id: '24', + name: 'BCM Gas Tube - Mid Length', + description: 'Stainless steel gas tube for mid-length gas systems.', + longDescription: 'BCM gas tubes are made from high-quality stainless steel and are compatible with most AR-15 barrels.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Tube', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Tube+Front', + 'https://placehold.co/600x400.png?text=Gas+Tube+Side' + ], + brand: { + id: 'b2', + name: 'BCM', + logo: 'https://placehold.co/100x50.png?text=BCM' + }, + category: { + id: 'c24', + name: 'Gas Tube', + icon: '๐Ÿงช' + }, + specifications: { + weight: '0.7 oz', + material: 'Stainless Steel', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 19.99, + url: 'https://bravocompanyusa.com/gas-tube', + vendor: { + name: 'BCM', + logo: 'https://placehold.co/80x40.png?text=BCM' + }, + inStock: true, + shipping: 'Flat rate $5' + } + ], + reviews: [], + relatedProducts: ['23'], + compatibility: ['Gas Block'] + }, + { + id: '25', + name: 'Aero Precision Gas Block - High Profile', + description: 'High-profile adjustable gas block for free-float handguards.', + longDescription: 'Aero Precision gas blocks are machined to tight tolerances and are perfect for custom AR builds.', + image_url: 'https://placehold.co/300x200.png?text=Gas+Block', + images: [ + 'https://placehold.co/600x400.png?text=Gas+Block+Front', + 'https://placehold.co/600x400.png?text=Gas+Block+Side' + ], + brand: { + id: 'b3', + name: 'Aero Precision', + logo: 'https://placehold.co/100x50.png?text=Aero' + }, + category: { + id: 'c25', + name: 'Gas Block', + icon: '๐Ÿ›‘' + }, + specifications: { + weight: '1.2 oz', + material: 'Steel', + finish: 'Phosphate', + compatibility: ['AR-15', 'M4'] + }, + restrictions: {}, + offers: [ + { + price: 59.99, + url: 'https://aeroprecisionusa.com/gas-block', + vendor: { + name: 'Aero Precision', + logo: 'https://placehold.co/80x40.png?text=Aero' + }, + inStock: true, + shipping: 'Flat rate $7' + } + ], + reviews: [], + relatedProducts: ['1', '2'], + compatibility: ['Barrel', 'Handguard'] + } +]; \ No newline at end of file diff --git a/src/mock/products.ts b/src/mock/products.ts deleted file mode 100644 index 0f896c9..0000000 --- a/src/mock/products.ts +++ /dev/null @@ -1,48 +0,0 @@ -export const mockProducts = [ - { - id: '1', - name: 'Faxon 16" Gunner Barrel - 5.56 NATO', - description: 'Lightweight, high-performance AR-15 barrel.', - image_url: 'https://via.placeholder.com/300x200?text=Barrel', - brand: { - id: 'b1', - name: 'Faxon Firearms', - }, - category: { - id: 'c1', - name: 'Barrel', - }, - offers: [ - { - price: 189.99, - url: 'https://primaryarms.com/faxon-16-gunner-barrel', - vendor: { - name: 'Primary Arms', - }, - }, - ], - }, - { - id: '2', - name: 'BCM M4 Upper Receiver', - description: 'Forged upper with M4 feed ramps.', - image_url: 'https://via.placeholder.com/300x200?text=Upper', - brand: { - id: 'b2', - name: 'BCM', - }, - category: { - id: 'c2', - name: 'Upper Receiver', - }, - offers: [ - { - price: 129.99, - url: 'https://rainierarms.com/bcm-m4-upper', - vendor: { - name: 'Rainier Arms', - }, - }, - ], - }, -]; \ No newline at end of file