feat: implement booking feature with service and time slot selection
This commit is contained in:
18
app/home/(user)/_components/booking/booking.context.ts
Normal file
18
app/home/(user)/_components/booking/booking.context.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { createContext } from 'react';
|
||||
|
||||
import { StoreProduct } from '@medusajs/types';
|
||||
import { noop } from 'lodash';
|
||||
|
||||
const BookingContext = createContext<{
|
||||
timeSlots: string[];
|
||||
selectedService: StoreProduct | null;
|
||||
setSelectedService: (selectedService: any) => void;
|
||||
updateTimeSlots: (serviceId: number) => Promise<void>;
|
||||
}>({
|
||||
timeSlots: [],
|
||||
selectedService: null,
|
||||
setSelectedService: (_) => _,
|
||||
updateTimeSlots: async (_) => noop(),
|
||||
});
|
||||
|
||||
export { BookingContext };
|
||||
Reference in New Issue
Block a user