import { useReducer } from 'react'
interface FormState {
values: Record<string, any>
errors: Record<string, string>
touched: Record<string, boolean>
export const initialCart = { items: {} };
export function cartReducer(state, action) {
switch (action.type) {
case 'ADD_ITEM': {
const { product, qty = 1 } = action;
export interface Todo {
id: string;
title: string;
done: boolean;
pending: boolean;
}
export const initialState = (steps, initialData = {}) => ({
steps,
stepIndex: 0,
data: initialData,
errors: {},
});
export interface Todo {
id: string;
title: string;
done: boolean;
}