Files
Filamenteka/src/config/categories.ts
DaX 1d3d11afec Refactor to multi-category catalog with polished light mode
- Restructure from single filament table to multi-category product catalog
  (filamenti, stampaci, ploce, mlaznice, delovi, oprema)
- Add shared layout components (SiteHeader, SiteFooter, CategoryNav, Breadcrumb)
- Add reusable UI primitives (Badge, Button, Card, Modal, PriceDisplay, EmptyState)
- Add catalog components (CatalogPage, ProductTable, ProductGrid, FilamentCard, ProductCard)
- Add admin dashboard with sidebar navigation and category management
- Add product API endpoints and database migrations
- Add SEO pages (politika-privatnosti, uslovi-koriscenja, robots.txt, sitemap.xml)
- Fix light mode: gradient text contrast, category nav accessibility,
  surface tokens, card shadows, CTA section theming
2026-02-21 21:56:17 +01:00

149 lines
5.2 KiB
TypeScript

import { ProductCategory } from '@/src/types/product';
export interface CategoryFilter {
key: string;
label: string;
type: 'select' | 'range' | 'checkbox';
options?: string[];
}
export interface CategoryConfig {
slug: string;
label: string;
labelShort: string;
labelEn: string;
apiCategory?: ProductCategory;
color: string;
colorHex: string;
icon: string;
description: string;
metaTitle: string;
metaDescription: string;
filters: CategoryFilter[];
enabled: boolean;
isFilament?: boolean;
}
export const CATEGORIES: CategoryConfig[] = [
{
slug: 'filamenti',
label: 'Filamenti',
labelShort: 'Filamenti',
labelEn: 'Filaments',
color: 'blue',
colorHex: '#3b82f6',
icon: '🧵',
description: 'Originalni Bambu Lab filamenti za 3D stampac. PLA, PETG, ABS, TPU i mnogi drugi materijali.',
metaTitle: 'Bambu Lab Filamenti | PLA, PETG, ABS - Filamenteka',
metaDescription: 'Originalni Bambu Lab filamenti za 3D stampac. PLA, PETG, ABS, TPU. Privatna prodaja u Srbiji.',
filters: [
{ key: 'material', label: 'Materijal', type: 'select', options: ['ABS', 'ASA', 'PA6', 'PAHT', 'PC', 'PET', 'PETG', 'PLA', 'PPA', 'PPS', 'TPU'] },
{ key: 'finish', label: 'Finish', type: 'select' },
{ key: 'color', label: 'Boja', type: 'select' },
],
enabled: true,
isFilament: true,
},
{
slug: 'stampaci',
label: '3D Stampaci',
labelShort: 'Stampaci',
labelEn: '3D Printers',
apiCategory: 'printer',
color: 'red',
colorHex: '#ef4444',
icon: '🖨️',
description: 'Bambu Lab 3D stampaci - A1 Mini, A1, P1S, X1C. Novi i polovni. Privatna prodaja u Srbiji.',
metaTitle: 'Bambu Lab 3D Stampaci | A1, P1S, X1C - Filamenteka',
metaDescription: 'Bambu Lab 3D stampaci - A1 Mini, A1, P1S, X1C. Novi i polovni. Privatna prodaja u Srbiji.',
filters: [
{ key: 'condition', label: 'Stanje', type: 'select', options: ['new', 'used_like_new', 'used_good', 'used_fair'] },
],
enabled: true,
},
{
slug: 'ploce',
label: 'Build Plate (Podloge)',
labelShort: 'Podloge',
labelEn: 'Build Plates',
apiCategory: 'build_plate',
color: 'green',
colorHex: '#22c55e',
icon: '📐',
description: 'Bambu Lab build plate podloge - Cool Plate, Engineering Plate, High Temp Plate, Textured PEI.',
metaTitle: 'Bambu Lab Build Plate (Podloga) - Filamenteka',
metaDescription: 'Bambu Lab build plate podloge - Cool Plate, Engineering Plate, High Temp Plate, Textured PEI.',
filters: [
{ key: 'condition', label: 'Stanje', type: 'select', options: ['new', 'used_like_new', 'used_good', 'used_fair'] },
{ key: 'printer_model', label: 'Kompatibilnost', type: 'select' },
],
enabled: true,
},
{
slug: 'mlaznice',
label: 'Mlaznice i Hotend (Nozzles)',
labelShort: 'Mlaznice',
labelEn: 'Nozzles & Hotend',
apiCategory: 'nozzle',
color: 'amber',
colorHex: '#f59e0b',
icon: '🔩',
description: 'Bambu Lab nozzle mlaznice i hotend za A1, P1, X1. Hardened steel, stainless steel dizne.',
metaTitle: 'Bambu Lab Nozzle i Hotend (Mlaznice/Dizne) - Filamenteka',
metaDescription: 'Bambu Lab nozzle mlaznice i hotend za A1, P1, X1. Hardened steel, stainless steel dizne.',
filters: [
{ key: 'condition', label: 'Stanje', type: 'select', options: ['new', 'used_like_new', 'used_good', 'used_fair'] },
{ key: 'printer_model', label: 'Kompatibilnost', type: 'select' },
],
enabled: true,
},
{
slug: 'delovi',
label: 'Rezervni Delovi (Spare Parts)',
labelShort: 'Delovi',
labelEn: 'Spare Parts',
apiCategory: 'spare_part',
color: 'purple',
colorHex: '#a855f7',
icon: '🔧',
description: 'Bambu Lab rezervni delovi - AMS, extruder, kablovi. Originalni spare parts za sve serije.',
metaTitle: 'Bambu Lab Rezervni Delovi (Spare Parts) - Filamenteka',
metaDescription: 'Bambu Lab rezervni delovi - AMS, extruder, kablovi. Originalni spare parts za sve serije.',
filters: [
{ key: 'condition', label: 'Stanje', type: 'select', options: ['new', 'used_like_new', 'used_good', 'used_fair'] },
{ key: 'printer_model', label: 'Kompatibilnost', type: 'select' },
],
enabled: true,
},
{
slug: 'oprema',
label: 'Oprema i Dodaci (Accessories)',
labelShort: 'Oprema',
labelEn: 'Accessories',
apiCategory: 'accessory',
color: 'cyan',
colorHex: '#06b6d4',
icon: '🛠️',
description: 'Bambu Lab oprema - AMS, spool holder, alati. Dodatna oprema za 3D stampace.',
metaTitle: 'Bambu Lab Oprema i Dodaci (Accessories) - Filamenteka',
metaDescription: 'Bambu Lab oprema - AMS, spool holder, alati. Dodatna oprema za 3D stampace.',
filters: [
{ key: 'condition', label: 'Stanje', type: 'select', options: ['new', 'used_like_new', 'used_good', 'used_fair'] },
],
enabled: true,
},
];
export const getCategoryBySlug = (slug: string): CategoryConfig | undefined =>
CATEGORIES.find(c => c.slug === slug);
export const getEnabledCategories = (): CategoryConfig[] =>
CATEGORIES.filter(c => c.enabled);
export const CONDITION_LABELS: Record<string, string> = {
new: 'Novo',
used_like_new: 'Kao novo',
used_good: 'Dobro stanje',
used_fair: 'Korisceno',
};