// Copyright © 2022 Olo Inc. All rights reserved.
// This software is made available under the Olo Pay SDK License (See LICENSE.md file)

#import <React/RCTComponentViewFactory.h>

// Forward declarations for all OloPay Fabric components
Class<RCTComponentViewProtocol> PaymentCardDetailsViewCls(void);
Class<RCTComponentViewProtocol> PaymentCardCvvViewCls(void);
Class<RCTComponentViewProtocol> PaymentCardDetailsFormCls(void);
Class<RCTComponentViewProtocol> DigitalWalletButtonCls(void);

// This function is called from the app's AppDelegate
extern "C" void registerOloPayComponents() {
    RCTComponentViewFactory *factory = [RCTComponentViewFactory currentComponentViewFactory];

    // Register each component
    [factory registerComponentViewClass:PaymentCardDetailsViewCls()];
    [factory registerComponentViewClass:PaymentCardCvvViewCls()];
    [factory registerComponentViewClass:PaymentCardDetailsFormCls()];
    [factory registerComponentViewClass:DigitalWalletButtonCls()];
}
