feat: add snapshot caching functionality to PricingEngine and implement snapshot store
This commit is contained in:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user