This commit is contained in:
2025-12-25 23:39:12 -03:00
parent 4ebbc048f1
commit e7aa6a6694
4 changed files with 34 additions and 15 deletions

View File

@@ -37,15 +37,19 @@ import { Skeleton } from '@repo/ui/components/skeleton'
type WizardState = {
index: number
kind: 'bulk' | 'assigned'
cart: any
payment: any
items?: object[]
coupon?: object
enrollments?: object[]
payment?: any
}
const emptyWizard: WizardState = {
index: 0,
kind: 'bulk',
cart: {},
payment: {}
items: undefined,
coupon: undefined,
enrollments: undefined,
payment: undefined
}
export function meta({}: Route.MetaArgs) {
@@ -80,12 +84,12 @@ export default function Route({
const index = state.index
const kind = state.kind
const props = {
...state,
courses,
defaultValues: state.cart,
onSubmit: async (data: any) =>
setState((prev) => ({
...(prev ?? emptyWizard),
cart: data
...data
}))
}