feat: add snapshot caching functionality to PricingEngine and implement snapshot store
CI/CD / test-and-build (push) Waiting to run
CI/CD / deploy (push) Blocked by required conditions

This commit is contained in:
Najjar\NajjarV02
2026-04-14 10:47:27 +04:00
parent bb3b1f25f2
commit 3fbdc3b187
2 changed files with 18 additions and 0 deletions
+4
View File
@@ -4,6 +4,7 @@ import { useEffect } from 'react';
import { useConfigStore } from '@/store/useConfigStore';
import { usePricingStore, pricingStore } from '@/store/usePricingStore';
import { orderStore } from '@/store/useOrderStore';
import { snapshotStore } from '@/store/useSnapshotStore';
const DEFAULT_COLOR = '#96a2b6';
@@ -31,6 +32,9 @@ export function PricingEngine() {
const personaLabel = items.find((i) => i.id === persona)?.label ?? '';
const handleProceed = () => {
// Cache the robot snapshot now, while the canvas is still visible
snapshotStore.getState().cacheSnapshot();
const store = orderStore.getState();
const lineItems: { label: string; price: number }[] = [
{ label: 'G1 Robot Base', price: basePrice },