///
/// HybridNitroVtoViewComponent.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2026 Marc Rousavy @ Margelo
///

#pragma once

#include <optional>
#include <NitroModules/NitroDefines.hpp>
#include <NitroModules/NitroHash.hpp>
#include <NitroModules/CachedProp.hpp>
#include <react/renderer/core/ConcreteComponentDescriptor.h>
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
#include <react/renderer/components/view/ViewProps.h>

#include <string>
#include <functional>
#include <optional>
#include <memory>
#include "HybridNitroVtoViewSpec.hpp"

namespace margelo::nitro::nitrovto::views {

  using namespace facebook;

  /**
   * The name of the actual native View.
   */
  extern const char HybridNitroVtoViewComponentName[];

  /**
   * Props for the "NitroVtoView" View.
   */
  class HybridNitroVtoViewProps final: public react::ViewProps {
  public:
    HybridNitroVtoViewProps() = default;
    HybridNitroVtoViewProps(const HybridNitroVtoViewProps&);
    HybridNitroVtoViewProps(const react::PropsParserContext& context,
                            const HybridNitroVtoViewProps& sourceProps,
                            const react::RawProps& rawProps);

  public:
    CachedProp<std::string> modelUrl;
    CachedProp<bool> isActive;
    CachedProp<std::optional<std::function<void(const std::string& /* modelUrl */)>>> onModelLoaded;
    CachedProp<std::optional<std::function<void()>>> onFaceTracked;
    CachedProp<std::optional<std::function<void(const std::string& /* modelUrl */)>>> onGlassesDisplayed;
    CachedProp<std::optional<double>> forwardOffset;
    CachedProp<std::optional<bool>> debug;
    CachedProp<std::optional<bool>> showNativeFPS;
    CachedProp<bool> isClipOn;
    CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridNitroVtoViewSpec>& /* ref */)>>> hybridRef;

  private:
    static bool filterObjectKeys(const std::string& propName);
  };

  /**
   * State for the "NitroVtoView" View.
   */
  class HybridNitroVtoViewState final {
  public:
    HybridNitroVtoViewState() = default;

  public:
    void setProps(const HybridNitroVtoViewProps& props) { _props.emplace(props); }
    const std::optional<HybridNitroVtoViewProps>& getProps() const { return _props; }

  public:
#ifdef ANDROID
  HybridNitroVtoViewState(const HybridNitroVtoViewState& /* previousState */, folly::dynamic /* data */) {}
  folly::dynamic getDynamic() const {
    throw std::runtime_error("HybridNitroVtoViewState does not support folly!");
  }
  react::MapBuffer getMapBuffer() const {
    throw std::runtime_error("HybridNitroVtoViewState does not support MapBuffer!");
  };
#endif

  private:
    std::optional<HybridNitroVtoViewProps> _props;
  };

  /**
   * The Shadow Node for the "NitroVtoView" View.
   */
  using HybridNitroVtoViewShadowNode = react::ConcreteViewShadowNode<HybridNitroVtoViewComponentName /* "HybridNitroVtoView" */,
                                                                     HybridNitroVtoViewProps /* custom props */,
                                                                     react::ViewEventEmitter /* default */,
                                                                     HybridNitroVtoViewState /* custom state */>;

  /**
   * The Component Descriptor for the "NitroVtoView" View.
   */
  class HybridNitroVtoViewComponentDescriptor final: public react::ConcreteComponentDescriptor<HybridNitroVtoViewShadowNode> {
  public:
    HybridNitroVtoViewComponentDescriptor(const react::ComponentDescriptorParameters& parameters);

  public:
    /**
     * A faster path for cloning props - reuses the caching logic from `HybridNitroVtoViewProps`.
     */
    std::shared_ptr<const react::Props> cloneProps(const react::PropsParserContext& context,
                                                   const std::shared_ptr<const react::Props>& props,
                                                   react::RawProps rawProps) const override;
#ifdef ANDROID
    void adopt(react::ShadowNode& shadowNode) const override;
#endif
  };

  /* The actual view for "NitroVtoView" needs to be implemented in platform-specific code. */

} // namespace margelo::nitro::nitrovto::views
