This commit is contained in:
MichalC
2026-08-25 23:51:18 +02:00
parent 1eaf90ebbf
commit e98a903e28
19 changed files with 381 additions and 260 deletions
+32 -23
View File
@@ -5,9 +5,12 @@ import Image from 'next/image';
import Link from 'next/link';
import {
Phone, ShoppingCart, GitCompare, Check,
Thermometer, Volume2, Zap, Wind, Star, Info, Eye, X, type LucideIcon
Thermometer, Volume2, Zap, Wind, Star, Info, Eye, X, Mail, type LucideIcon
} from 'lucide-react';
import { Product } from '@/content/products';
import { formatCurrency } from "@/lib/utils";
import { companyDetails } from "@/content/company";
import { Button, buttonClasses } from "@/components/ui/Button";
import { useCartStore } from '@/lib/cart-store';
import { useCompareStore } from '@/lib/compare-store';
import { getProductVariants } from '@/content/product-variants';
@@ -277,41 +280,47 @@ export function ProductPageClient({ product, seriesProducts, companyPhone, compa
<>
<div className="flex items-end gap-3 mb-1">
<span className="text-2xl font-extrabold text-primary font-heading">
{currentProduct.price.toLocaleString('pl-PL')} zł
{formatCurrency(currentProduct.price)}
</span>
</div>
<p className="text-xs text-text-muted mb-1">cena urządzenia brutto (23% VAT)</p>
<p className="text-xs text-text-muted mb-4">Montaż wyceniamy indywidualnie — zadzwoń lub napisz</p>
<div className="flex flex-col sm:flex-row gap-3">
<div className="flex flex-col gap-3">
{cartState === 'idle' && (
<button
<Button
onClick={handleAddToCart}
className="flex-1 flex items-center justify-center gap-2 py-2.5 px-4 rounded-xl font-bold text-sm bg-accent text-white hover:bg-accent/90 transition-all"
variant="primary"
size="lg"
className="w-full justify-center"
>
<ShoppingCart className="size-4" /> Do koszyka
</button>
</Button>
)}
{cartState === 'added' && (
<button
<Button
disabled
className="flex-1 flex items-center justify-center gap-2 py-2.5 px-4 rounded-xl font-bold text-sm bg-green-500 text-white"
variant="success"
size="lg"
className="w-full justify-center"
>
<Check className="size-4" /> Dodano do koszyka
</button>
</Button>
)}
{cartState === 'cart' && (
<Link href="/koszyk" className="flex-1 w-full flex items-center justify-center gap-2 py-2.5 px-4 rounded-xl font-bold text-sm bg-green-500 text-white hover:bg-green-600 transition-colors">
<ShoppingCart className="size-4" /> Zobacz koszyk
</Link>
<Link
href="/koszyk"
className={buttonClasses({ variant: 'success', size: 'lg', className: 'w-full justify-center' })}
>
<ShoppingCart className="size-4" /> Zobacz koszyk
</Link>
)}
<Link href="/kontakt" className="flex-1 w-full flex items-center justify-center gap-2 py-2.5 px-4 rounded-xl font-bold text-sm border-2 border-primary text-primary hover:bg-primary hover:text-white transition-all">
Zapytaj o montaż
</Link>
<Link
href="/kontakt"
className={buttonClasses({ variant: 'outline', size: 'lg', className: 'w-full justify-center' })}
>
<Mail className="size-4" /> Zapytaj o montaż
</Link>
</div>
<button
@@ -328,7 +337,7 @@ export function ProductPageClient({ product, seriesProducts, companyPhone, compa
<>
<p className="text-lg font-bold text-primary font-heading mb-1">Cena na zapytanie</p>
<p className="text-sm text-text-muted mb-4">Multisplit — cena zależy od konfiguracji jednostek wewnętrznych.</p>
<a href={`tel:${companyPhoneRaw}`} className="flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-accent text-white font-bold text-sm hover:bg-accent/90 transition-colors">
<a href={`tel:${companyPhoneRaw}`} className={buttonClasses({ variant: 'primary', size: 'md', className: 'w-full' })}>
<Phone className="size-4" /> Zadzwoń: {companyPhone}
</a>
</>
@@ -337,7 +346,7 @@ export function ProductPageClient({ product, seriesProducts, companyPhone, compa
<a
href={`tel:${companyPhoneRaw}`}
className="flex items-center justify-between px-5 py-2.5 bg-primary rounded-xl text-white hover:bg-primary/90 transition-colors"
className={buttonClasses({ variant: 'outline', size: 'lg', className: 'w-full justify-between' })}
>
<span className="text-xs font-semibold">Profesjonalna porada</span>
<span className="flex items-center gap-2 font-bold">
@@ -458,7 +467,7 @@ export function ProductPageClient({ product, seriesProducts, companyPhone, compa
</li>
))}
</ul>
<a href={`tel:${companyPhoneRaw}`} className="mt-4 inline-flex items-center gap-2 btn btn-primary text-white font-bold text-sm">
<a href={`tel:${companyPhoneRaw}`} className={buttonClasses({ variant: 'primary', size: 'md', className: 'mt-4' })}>
<Phone className="size-4" /> Zapytaj o montaż
</a>
</div>
@@ -483,7 +492,7 @@ export function ProductPageClient({ product, seriesProducts, companyPhone, compa
<label className="text-sm font-semibold text-primary">Treść opinii</label>
<textarea required rows={4} className="w-full px-4 py-2.5 rounded-xl border border-border bg-white text-sm focus:outline-none focus:ring-2 focus:ring-accent/50" placeholder="Podziel się swoimi wrażeniami..."></textarea>
</div>
<button type="submit" className="btn btn-primary font-bold text-white w-full sm:w-auto">Wyślij opinię</button>
<Button type="submit" variant="primary" className="w-full sm:w-auto">Wyślij opinię</Button>
</form>
</div>
<div className="space-y-4">