import React from 'react'; import * as operationsSDK from '@wix/auto_sdk_restaurants_operations'; import { DispatchType, FulfillmentsServiceConfig, TimeSlot } from '../../types/fulfillments-types.js'; import * as fulfillemtMethodsSDK from '@wix/auto_sdk_restaurants_fulfillment-methods'; export interface RootProps { children: (props: { isLoading: boolean; }) => React.ReactNode; fulfillmentsServiceConfig?: FulfillmentsServiceConfig; } /** * Core Settings Root component that provides service context * Wraps children with both OLOSettingsService and FulfillmentsService providers * * Note: Use loadFulfillmentsServiceConfig from '@wix/headless-restaurants-olo/services' * to load the config before rendering this component. * * @example * ```tsx * import { loadFulfillmentsServiceConfig, OLOSettingsServiceDefinition } from '@wix/headless-restaurants-olo/services'; * * // In your component: * const service = useService(OLOSettingsServiceDefinition); * const [config, setConfig] = useState(null); * * useEffect(() => { * loadFulfillmentsServiceConfig(service.operation?.get()).then(setConfig); * }, []); * * if (!config) return
Loading...
; * * * * {({ timeSlot, hasDetails }) => ( *
{timeSlot?.dispatchType}
* )} *
*
* ``` */ export declare const Root: React.FC; export interface CurrentTimeSlotProps { children: (props: { timeSlot: TimeSlot; hasDetails: boolean; asapTime: number | undefined; asapTimeRange: operationsSDK.DurationRange | undefined; }) => React.ReactNode; } /** * Component that provides access to current time slot * * @example * ```tsx * * {({ timeSlot, hasDetails }) => ( * hasDetails ? ( *
*

{timeSlot.dispatchType}

*
* ) : ( *
No time slot selected
* ) * )} *
* ``` */ export declare const CurrentTimeSlot: React.FC; export interface CurrentFulfillmentProps { children: (props: { fulfillment: { current?: operationsSDK.TimeSlot; }; hasFulfillment: boolean; availableOptions: string[]; }) => React.ReactNode; } /** * Component that provides access to current fulfillment options * * @example * ```tsx * * {({ fulfillment, availableOptions }) => ( *
*

Available Options:

* {availableOptions.map(option => ( *
{option}: Available
* ))} *
* )} *
* ``` */ export declare const CurrentFulfillment: React.FC; export interface CurrentLocationProps { children: (props: { location: { name: string; }; hasLocation: boolean; }) => React.ReactNode; } /** * Component that provides access to current location data * * @example * ```tsx * * {({ location, hasLocation }) => ( *
*

{location.name}

*
* )} *
* ``` */ export declare const CurrentLocation: React.FC; export interface MinOrderAmountProps { children: (props: { minOrderAmount: number | undefined; hasMinOrderAmount: boolean; }) => React.ReactNode; } /** * Component that provides access to minimum order amount information * * @example * ```tsx * * {({ minOrderAmount, hasMinOrderAmount }) => ( * hasMinOrderAmount ? ( *
Minimum order: ${minOrderAmount}
* ) : null * )} *
* ``` */ export declare const MinOrderAmount: React.FC; export interface AcceptingOrdersProps { children: (props: { acceptingOrders: boolean; }) => React.ReactNode; } /** * Component that provides access to accepting orders status * * @example * ```tsx * * {({ acceptingOrders }) => ( *
* Status: {acceptingOrders ? 'Accepting Orders' : 'Not Accepting Orders'} *
* )} *
* ``` */ export declare const AcceptingOrders: React.FC; export interface DeliveryFeeProps { children: (props: { deliveryFee: string | undefined; hasDeliveryFee: boolean; }) => React.ReactNode; } /** * Component that provides access to delivery fee information * * @example * ```tsx * * {({ deliveryFee, hasDeliveryFee }) => ( * hasDeliveryFee ? ( *
Delivery Fee: ${deliveryFee}
* ) : ( *
Free Delivery
* ) * )} *
* ``` */ export declare const DeliveryFee: React.FC; export interface FreeDeliveryThresholdProps { children: (props: { freeDeliveryThreshold: string | undefined; hasFreeDeliveryThreshold: boolean; }) => React.ReactNode; } /** * Component that provides access to free delivery threshold information * * @example * ```tsx * * {({ freeDeliveryThreshold, hasFreeDeliveryThreshold }) => ( * hasFreeDeliveryThreshold ? ( *
Free delivery on orders over ${freeDeliveryThreshold}
* ) : null * )} *
* ``` */ export declare const FreeDeliveryThreshold: React.FC; export interface SelectedAddressProps { children: (props: { selectedAddress: fulfillemtMethodsSDK.CommonAddress | null; hasAddress: boolean; selectedType: DispatchType | null; }) => React.ReactNode; } /** * Component that provides access to the selected address * * @example * ```tsx * * {({ address, hasAddress }) => ( * hasAddress ? ( *
*

{address.street}

*

{address.city}, {address.state} {address.zip}

*

{address.country}

*
* ) : null * )} *
* ``` */ export declare const SelectedAddress: React.FC; export interface DispatchTypeSelectorProps { children: (props: { availableTypes: Array<{ type: DispatchType; isSelected: boolean; timeSlot: TimeSlot | null; }>; selectedType: DispatchType | null; selectDispatchType: (type: DispatchType) => void; hasTypes: boolean; }) => React.ReactNode; } /** * Component that provides dispatch type selection (pickup or delivery) * * @example * ```tsx * * {({ availableTypes, selectedType, selectDispatchType }) => ( *
* {availableTypes.map(({ type, isSelected }) => ( * * ))} *
* )} *
* ``` */ export declare const DispatchTypeSelector: React.FC;