From 5f85f33af01416794b594111d5787ae183ac97ae Mon Sep 17 00:00:00 2001 From: AI Assistant Date: Mon, 10 Aug 2026 23:41:14 +0200 Subject: [PATCH] changes --- components/kalkulator/KalkulatorClient.tsx | 22 +++++++++++++++++++++- components/layout/Footer.tsx | 2 +- components/shop/ProductsGrid.tsx | 14 ++++++++++---- content/company.ts | 16 ++++++++-------- 4 files changed, 40 insertions(+), 14 deletions(-) diff --git a/components/kalkulator/KalkulatorClient.tsx b/components/kalkulator/KalkulatorClient.tsx index 3f4022a..02a9b12 100644 --- a/components/kalkulator/KalkulatorClient.tsx +++ b/components/kalkulator/KalkulatorClient.tsx @@ -125,6 +125,26 @@ export function KalkulatorClient({ products }: Props) { window.scrollTo({ top: 0, behavior: 'smooth' }); }; + const getShopUrl = () => { + const params = new URLSearchParams(); + if (category) params.set('category', category); + if (preferredBrand) params.set('brand', preferredBrand); + + const avgInstallCost = (installCost.min + installCost.max) / 2; + const deviceBudget = Math.max(0, budget - avgInstallCost); + if (deviceBudget > 0) params.set('priceMax', Math.round(deviceBudget).toString()); + + if (category === 'scienne') { + if (requiredPowerRounded <= 2.5) params.set('room', 'Do 25 m²'); + else if (requiredPowerRounded <= 3.5) params.set('room', '25-35 m²'); + else if (requiredPowerRounded <= 5.0) params.set('room', '35-50 m²'); + else params.set('room', 'Powyżej 50 m²'); + } else if (category === 'multisplit') { + params.set('units', rooms.toString()); + } + + return `/sklep?${params.toString()}`; + }; return (
@@ -599,7 +619,7 @@ export function KalkulatorClient({ products }: Props) { Dalej ) : ( - + Przejdź do sklepu diff --git a/components/layout/Footer.tsx b/components/layout/Footer.tsx index ca7a7ec..bbc5a92 100644 --- a/components/layout/Footer.tsx +++ b/components/layout/Footer.tsx @@ -140,7 +140,7 @@ export function Footer() {

- © {currentYear} {companyDetails.name}. Wszelkie prawa zastrzeżone. Projekt strony i wdrożenie ThermCool. + © {currentYear} {companyDetails.name}. Wszelkie prawa zastrzeżone. Projekt strony i wdrożenie Powered by NetScale.

diff --git a/components/shop/ProductsGrid.tsx b/components/shop/ProductsGrid.tsx index abca319..3c90ef7 100644 --- a/components/shop/ProductsGrid.tsx +++ b/components/shop/ProductsGrid.tsx @@ -80,6 +80,9 @@ export function ProductsGrid({ products, brands }: ProductsGridProps) { const urlSearch = searchParams.get('search') || ''; const urlBrand = searchParams.get('brand') || ''; const urlCategory = searchParams.get('category') || 'all'; + const urlPriceMax = searchParams.get('priceMax') || ''; + const urlRoom = searchParams.get('room') || ''; + const urlUnits = searchParams.get('units') || ''; const [category, setCategory] = useState<'all' | 'scienne' | 'multisplit' | 'podlogowe' | 'jednostka-scienna'>( urlCategory as 'all' | 'scienne' | 'multisplit' | 'podlogowe' | 'jednostka-scienna' @@ -87,10 +90,10 @@ export function ProductsGrid({ products, brands }: ProductsGridProps) { const [selectedBrands, setSelectedBrands] = useState(urlBrand ? [urlBrand] : []); const [searchQuery, setSearchQuery] = useState(urlSearch); const [priceMin, setPriceMin] = useState(''); - const [priceMax, setPriceMax] = useState(''); - const [selectedRooms, setSelectedRooms] = useState([]); + const [priceMax, setPriceMax] = useState(urlPriceMax); + const [selectedRooms, setSelectedRooms] = useState(urlRoom ? [urlRoom] : []); const [selectedColors, setSelectedColors] = useState([]); - const [selectedUnitCounts, setSelectedUnitCounts] = useState([]); + const [selectedUnitCounts, setSelectedUnitCounts] = useState(urlUnits ? [parseInt(urlUnits)] : []); const [page, setPage] = useState(1); const [mobileSidebarOpen, setMobileSidebarOpen] = useState(false); @@ -104,10 +107,13 @@ export function ProductsGrid({ products, brands }: ProductsGridProps) { } else { setCategory('all'); } + setPriceMax(urlPriceMax); + setSelectedRooms(urlRoom ? [urlRoom] : []); + setSelectedUnitCounts(urlUnits ? [parseInt(urlUnits)] : []); setPage(1); }, 0); return () => clearTimeout(timer); - }, [urlSearch, urlBrand, urlCategory]); + }, [urlSearch, urlBrand, urlCategory, urlPriceMax, urlRoom, urlUnits]); const toggleBrand = (b: string) => { setSelectedBrands(prev => prev.includes(b) ? prev.filter(x => x !== b) : [...prev, b]); diff --git a/content/company.ts b/content/company.ts index 866f0c7..2b53cfb 100644 --- a/content/company.ts +++ b/content/company.ts @@ -1,15 +1,15 @@ export const companyDetails = { - name: "ThermCool", + name: "Klimat-24", legalName: "OLEH VAINAHII OVAK", - shortName: "ThermCool", - nip: "8952262125", + shortName: "Klimat-24", + nip: "8982288023", regon: "526442541", - phone: "+48 730 994 376", - phoneRaw: "+48730994376", - email: "biuro@thermcool.pl", + phone: "+48 699 587 035", + phoneRaw: "+48699587035", + email: "biuro@klimat-24.pl", address: { - street: "ul. Litewska 16 lok. 10", - zipCode: "51-354", + street: "ul. Joachima Lelewela 15 lok. 6", + zipCode: "53-505", city: "Wrocław", region: "Dolny Śląsk", },