chore: update content, sitemap and lib files

This commit is contained in:
MichalC
2026-08-01 14:01:54 +02:00
parent 6808dee9be
commit 092cff1899
8 changed files with 8 additions and 19 deletions
+1 -4
View File
@@ -39,7 +39,6 @@ export default function sitemap(): MetadataRoute.Sitemap {
priority: route === '' ? 1 : 0.8, priority: route === '' ? 1 : 0.8,
})); }));
// Dynamiczne produkty
const products = getProducts(); const products = getProducts();
const productRoutes = products.map((product) => ({ const productRoutes = products.map((product) => ({
url: `${baseUrl}/sklep/${product.slug}`, url: `${baseUrl}/sklep/${product.slug}`,
@@ -48,16 +47,14 @@ export default function sitemap(): MetadataRoute.Sitemap {
priority: 0.8, priority: 0.8,
})); }));
// Dynamiczne artykuły na blogu
const posts = getPosts(); const posts = getPosts();
const postRoutes = posts.map((post) => ({ const postRoutes = posts.map((post) => ({
url: `${baseUrl}/blog/${post.slug}`, url: `${baseUrl}/blog/${post.slug}`,
lastModified: post.date, // Używamy daty publikacji jako lastModified lastModified: post.date,
changeFrequency: 'monthly' as const, changeFrequency: 'monthly' as const,
priority: 0.6, priority: 0.6,
})); }));
// Dynamiczne strony miast
const cityRoutes = dolnySlaskCities.map((city) => ({ const cityRoutes = dolnySlaskCities.map((city) => ({
url: `${baseUrl}/klimatyzacja/${city.slug}`, url: `${baseUrl}/klimatyzacja/${city.slug}`,
lastModified: new Date().toISOString(), lastModified: new Date().toISOString(),
-1
View File
@@ -6,7 +6,6 @@ export interface FaqItem {
} }
export const faqData: FaqItem[] = [ export const faqData: FaqItem[] = [
// Klimatyzacja
{ {
id: 'klimatyzacja-moc', id: 'klimatyzacja-moc',
question: 'Jak dobrać odpowiednią moc klimatyzatora?', question: 'Jak dobrać odpowiednią moc klimatyzatora?',
+2 -2
View File
@@ -2,8 +2,8 @@ export interface PricingItem {
id: string; id: string;
name: string; name: string;
priceNet: number; priceNet: number;
priceGrossPrivate: number; // 8% VAT priceGrossPrivate: number;
priceGrossCompany: number; // 23% VAT priceGrossCompany: number;
category: 'split' | 'multisplit' | 'additional'; category: 'split' | 'multisplit' | 'additional';
} }
-1
View File
@@ -1,6 +1,5 @@
import { ProcessStep } from "@/types/types"; import { ProcessStep } from "@/types/types";
// MOCK
export const mainProcessSteps: ProcessStep[] = [ export const mainProcessSteps: ProcessStep[] = [
{ {
number: 1, number: 1,
+1 -4
View File
@@ -21,7 +21,6 @@ export function getProductVariants(slug: string): ProductVariants | null {
const currentProduct = products.find(p => p.slug === slug); const currentProduct = products.find(p => p.slug === slug);
if (!currentProduct) return null; if (!currentProduct) return null;
// Extract series from SKU (e.g., GREE-PULAR-PU09S -> GREE-PULAR)
const skuParts = currentProduct.sku.split('-'); const skuParts = currentProduct.sku.split('-');
if (skuParts.length < 2) return null; if (skuParts.length < 2) return null;
const series = skuParts.slice(0, -1).join('-'); const series = skuParts.slice(0, -1).join('-');
@@ -31,7 +30,6 @@ export function getProductVariants(slug: string): ProductVariants | null {
const currentMoc = currentProduct.specs['Moc chłodnicza'] || ''; const currentMoc = currentProduct.specs['Moc chłodnicza'] || '';
const currentWykończenie = currentProduct.specs['Wykończenie'] || ''; const currentWykończenie = currentProduct.specs['Wykończenie'] || '';
// Moce: same series, same wykończenie
const moceProducts = seriesProducts.filter(p => (p.specs['Wykończenie'] || '') === currentWykończenie); const moceProducts = seriesProducts.filter(p => (p.specs['Wykończenie'] || '') === currentWykończenie);
const moce = moceProducts const moce = moceProducts
.filter(p => p.specs['Moc chłodnicza'] && p.price) .filter(p => p.specs['Moc chłodnicza'] && p.price)
@@ -46,7 +44,6 @@ export function getProductVariants(slug: string): ProductVariants | null {
}) })
.sort((a, b) => (a.moc_float || 0) - (b.moc_float || 0)); .sort((a, b) => (a.moc_float || 0) - (b.moc_float || 0));
// Wykończenia: same series, same moc
const wykończeniaProducts = seriesProducts.filter(p => (p.specs['Moc chłodnicza'] || '') === currentMoc); const wykończeniaProducts = seriesProducts.filter(p => (p.specs['Moc chłodnicza'] || '') === currentMoc);
let wykończenia = wykończeniaProducts let wykończenia = wykończeniaProducts
.filter(p => p.specs['Wykończenie'] && p.price) .filter(p => p.specs['Wykończenie'] && p.price)
@@ -56,7 +53,7 @@ export function getProductVariants(slug: string): ProductVariants | null {
cena: p.price as number, cena: p.price as number,
})); }));
// If there's only 1 finish available in the entire series, don't show the variants selector
const allFinishesInSeries = new Set(seriesProducts.map(p => p.specs['Wykończenie'] || '').filter(Boolean)); const allFinishesInSeries = new Set(seriesProducts.map(p => p.specs['Wykończenie'] || '').filter(Boolean));
if (allFinishesInSeries.size <= 1) { if (allFinishesInSeries.size <= 1) {
wykończenia = []; wykończenia = [];
+1 -1
View File
@@ -1,6 +1,6 @@
import { Testimonial } from "@/types/types"; import { Testimonial } from "@/types/types";
// MOCK
export const testimonials: Testimonial[] = [ export const testimonials: Testimonial[] = [
{ {
name: "Mariusz Wójcik", name: "Mariusz Wójcik",
+1 -4
View File
@@ -31,7 +31,7 @@ export const useConsentStore = create<ConsentState>((set) => ({
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
let stored = localStorage.getItem(CONSENT_KEY); let stored = localStorage.getItem(CONSENT_KEY);
// Migration logic
if (!stored) { if (!stored) {
const oldStored = localStorage.getItem(OLD_CONSENT_KEY); const oldStored = localStorage.getItem(OLD_CONSENT_KEY);
if (oldStored) { if (oldStored) {
@@ -47,7 +47,6 @@ export const useConsentStore = create<ConsentState>((set) => ({
localStorage.setItem(CONSENT_KEY, stored); localStorage.setItem(CONSENT_KEY, stored);
localStorage.removeItem(OLD_CONSENT_KEY); localStorage.removeItem(OLD_CONSENT_KEY);
} catch { } catch {
// Ignore if parse fails
} }
} }
} }
@@ -64,11 +63,9 @@ export const useConsentStore = create<ConsentState>((set) => ({
advertising: !!parsed.advertising, advertising: !!parsed.advertising,
}); });
} catch { } catch {
// If parsing fails, show banner
set({ isInitialized: true, isOpen: true }); set({ isInitialized: true, isOpen: true });
} }
} else { } else {
// No consent found, show banner
set({ isInitialized: true, isOpen: true }); set({ isInitialized: true, isOpen: true });
} }
} }
+2 -2
View File
@@ -12,10 +12,10 @@ export function escapeHtml(unsafe: string): string {
const rateLimitMap = new Map<string, { count: number; expiresAt: number }>(); const rateLimitMap = new Map<string, { count: number; expiresAt: number }>();
const MAX_REQUESTS = 5; const MAX_REQUESTS = 5;
const WINDOW_MS = 10 * 60 * 1000; // 10 minutes const WINDOW_MS = 10 * 60 * 1000;
export function rateLimit(ip: string | undefined | null): boolean { export function rateLimit(ip: string | undefined | null): boolean {
if (!ip) return true; // fallback if IP can't be resolved if (!ip) return true;
const now = Date.now(); const now = Date.now();
const entry = rateLimitMap.get(ip); const entry = rateLimitMap.get(ip);