feat: implement compare functionality, checkout flow, and add 30 blog posts

This commit is contained in:
MichalC
2026-06-27 18:09:22 +02:00
parent 6bdfe18e18
commit 0c59086a6b
63 changed files with 9766 additions and 1874 deletions
+4 -25
View File
@@ -5,10 +5,10 @@ import Image from 'next/image';
import Link from 'next/link';
import { useCartStore } from '@/lib/cart-store';
import { formatCurrency } from '@/lib/utils';
import { Minus, Plus, Trash2, Wrench } from 'lucide-react';
import { Minus, Plus, Trash2 } from 'lucide-react';
export function CartItems() {
const { items, removeItem, updateQuantity, toggleInstall } = useCartStore();
const { items, removeItem, updateQuantity } = useCartStore();
if (items.length === 0) {
return (
@@ -28,7 +28,7 @@ export function CartItems() {
return (
<div className="space-y-6">
{items.map((item) => {
const itemPrice = item.withInstall ? item.priceWithInstall : item.price;
const itemPrice = item.price;
const totalGross = itemPrice * item.quantity;
return (
@@ -63,31 +63,10 @@ export function CartItems() {
{item.name}
</Link>
</h3>
{/* Wariant mocowy */}
{(item.label || item.power) && (
<div className="text-sm text-text-muted mb-3">
Wariant: <span className="font-semibold text-primary">{item.label || `${item.power} kW`}</span>
</div>
)}
</div>
{/* Opcja Montażu i Cena jednostkowa */}
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-4 mt-4">
<label className="flex items-center gap-2 cursor-pointer group">
<div className="relative flex items-center">
<input
type="checkbox"
checked={item.withInstall}
onChange={() => toggleInstall(item.id)}
className="w-5 h-5 rounded border-border text-green-600 focus:ring-green-600"
/>
</div>
<span className={`text-sm font-semibold flex items-center gap-1.5 ${item.withInstall ? 'text-green-700' : 'text-text-muted group-hover:text-primary'}`}>
<Wrench className="w-4 h-4" />
Z montażem
</span>
</label>
<div className="flex flex-col sm:flex-row sm:items-center justify-end gap-4 mt-4">
{/* Ilość i Cena */}
<div className="flex items-center gap-6">
<div className="flex items-center border border-border rounded-lg bg-slate-50">