feat: update phone number prices and remove kasetonowe

This commit is contained in:
AI Assistant
2026-07-12 12:26:25 +02:00
parent d4edb85c77
commit 1bee3869ec
15 changed files with 56 additions and 2112 deletions
+25 -3
View File
@@ -32,9 +32,14 @@ function calculatePower(m2: number, floor: string, sun: string, building: string
}
// Szacunkowy koszt montażu
function estimateInstall(pipes: string, rooms: number): { min: number; max: number } {
function estimateInstall(pipes: string, rooms: number, installMethod: string): { min: number; max: number } {
const base = rooms === 1 ? 1400 : rooms === 2 ? 2400 : rooms === 3 ? 3200 : 3800;
const pipeExtra = pipes === 'short' ? 0 : pipes === 'medium' ? 300 : pipes === 'long' ? 700 : 1200;
// Przybliżona liczba dodatkowych metrów (powyżej 3m)
const extraMeters = pipes === 'short' ? 0 : pipes === 'medium' ? 3 : pipes === 'long' ? 7 : 15;
const methodPrice = installMethod === 'bruzda' ? 90 : 80; // zł za metr
// Zostawmy bazowe koszty rur miedzianych (np. miedź, kable) i dodajmy koszt bruzdy/korytka
const pipeBaseCost = pipes === 'short' ? 0 : pipes === 'medium' ? 200 : pipes === 'long' ? 500 : 1000;
const pipeExtra = pipeBaseCost + (extraMeters * methodPrice);
return { min: base + pipeExtra, max: base + pipeExtra + 600 };
}
@@ -68,6 +73,7 @@ export function KalkulatorClient({ products }: Props) {
setPomieszczenia(prev => prev.map((r, idx) => idx === i ? { ...r, m2 } : r));
};
const [pipes, setPipes] = useState('medium'); // short(<3m) | medium(3-6m) | long(6-10m) | verylong(>10m)
const [installMethod, setInstallMethod] = useState<'korytko' | 'bruzda'>('korytko');
const [budget, setBudget] = useState(8000);
const [showResults, setShowResults] = useState(false);
const [preferredBrand, setPreferredBrand] = useState('');
@@ -79,7 +85,7 @@ export function KalkulatorClient({ products }: Props) {
[pomieszczenia, floor, sun, building]
);
const requiredPowerRounded = Math.round(requiredPower * 10) / 10;
const installCost = useMemo(() => estimateInstall(pipes, rooms), [pipes, rooms]);
const installCost = useMemo(() => estimateInstall(pipes, rooms, installMethod), [pipes, rooms, installMethod]);
const category = rooms === 1 ? 'scienne' : 'multisplit';
@@ -607,6 +613,22 @@ export function KalkulatorClient({ products }: Props) {
))}
</div>
<div>
<label className="text-sm font-semibold text-primary mb-3 block">Sposób prowadzenia instalacji (powyżej 3m)</label>
<div className="flex flex-col gap-3">
{[
{ value: 'korytko', label: 'Korytko PCV', sub: 'Rury schowane w białym korytku (80 zł/mb)' },
{ value: 'bruzda', label: 'Bruzda w ścianie', sub: 'Rury ukryte w wykutej bruzdzie (90 zł/mb)' },
].map(o => (
<button key={o.value} onClick={() => setInstallMethod(o.value as 'korytko' | 'bruzda')}
className={`p-4 rounded-xl border-2 text-left transition-all ${installMethod === o.value ? 'border-accent bg-accent/5' : 'border-border hover:border-accent'}`}>
<p className="text-sm font-bold text-primary">{o.label}</p>
<p className="text-xs text-text-muted">{o.sub}</p>
</button>
))}
</div>
</div>
<div className="p-3 bg-orange-50 rounded-xl text-xs text-orange-700">
Szacowany koszt montażu dla Twojej konfiguracji:
<strong className="ml-1">{installCost.min.toLocaleString('pl-PL')}–{installCost.max.toLocaleString('pl-PL')} zł</strong>
+1 -1
View File
@@ -11,7 +11,7 @@ const acTypes = [
image: '/images/services/split.webp',
description: 'Najpopularniejsze rozwiązanie do jednego pomieszczenia. Składa się z jednej jednostki wewnętrznej i jednej zewnętrznej.',
icon: Wind,
subtypes: ['Ścienne', 'Konsolowe', 'Kasetonowe', 'Kanałowe'],
subtypes: ['Ścienne', 'Konsolowe', 'Kanałowe'],
link: '/sklep?category=scienne',
},
{
+3 -4
View File
@@ -81,8 +81,8 @@ export function ProductsGrid({ products, brands }: ProductsGridProps) {
const urlBrand = searchParams.get('brand') || '';
const urlCategory = searchParams.get('category') || 'all';
const [category, setCategory] = useState<'all' | 'scienne' | 'multisplit' | 'kasetonowe' | 'podlogowe' | 'jednostka-scienna'>(
urlCategory as 'all' | 'scienne' | 'multisplit' | 'kasetonowe' | 'podlogowe' | 'jednostka-scienna'
const [category, setCategory] = useState<'all' | 'scienne' | 'multisplit' | 'podlogowe' | 'jednostka-scienna'>(
urlCategory as 'all' | 'scienne' | 'multisplit' | 'podlogowe' | 'jednostka-scienna'
);
const [selectedBrands, setSelectedBrands] = useState<string[]>(urlBrand ? [urlBrand] : []);
const [searchQuery, setSearchQuery] = useState(urlSearch);
@@ -99,7 +99,7 @@ export function ProductsGrid({ products, brands }: ProductsGridProps) {
setSearchQuery(urlSearch);
setSelectedBrands(urlBrand ? [urlBrand] : []);
if (urlCategory !== 'all') {
setCategory(urlCategory as 'scienne' | 'multisplit' | 'kasetonowe' | 'podlogowe' | 'jednostka-scienna');
setCategory(urlCategory as 'scienne' | 'multisplit' | 'podlogowe' | 'jednostka-scienna');
} else {
setCategory('all');
}
@@ -226,7 +226,6 @@ export function ProductsGrid({ products, brands }: ProductsGridProps) {
{ val: 'all', label: 'Wszystkie' },
{ val: 'scienne', label: 'Ścienne split' },
{ val: 'multisplit', label: 'Multisplit' },
/* { val: 'kasetonowe', label: 'Kasetonowe' }, */
].map(opt => (
<li key={opt.val}>
<button