'use client'; import { createOrderStore } from './store'; import { createContext, type PropsWithChildren, useRef } from 'react'; export type OrderStoreApi = ReturnType; export const OrderStoreContext = createContext(undefined); export function OrderStoreProvider({ children }: Readonly) { const storeRef = useRef(null); if (storeRef.current === null) { storeRef.current = createOrderStore(); } return {children}; }