feat: add product catalog with URL-based category filtering
Build & Deploy (develop) / build-and-deploy (push) Successful in 1m48s

This commit is contained in:
2026-09-15 11:14:40 +03:30
parent 421760dc62
commit f49ef11c9c
16 changed files with 198 additions and 26 deletions
+16
View File
@@ -0,0 +1,16 @@
import type {Locale, Machine, ProductCategory} from '@/types/domain';
export const productCategories: {id: ProductCategory; label: Record<Locale, string>}[] = [
{id: 'warm-vending', label: {fa: 'وندینگ گرم', en: 'Warm vending'}},
];
// Keep the home showcase independent of future catalog additions.
const featuredIds = ['rm-35', 'rm-48', 'rm-60'];
export function featuredMachines(machines: Machine[]): Machine[] {
return featuredIds.flatMap(id => machines.filter(machine => machine.id === id));
}
export function filterMachines(machines: Machine[], category: string): Machine[] {
return category ? machines.filter(machine => machine.category === category) : machines;
}