text: /*
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  
  #pragma once
  
  #include <ABI43_0_0React/ABI43_0_0renderer/components/safeareaview/SafeAreaViewShadowNode.h>
  #include <ABI43_0_0React/ABI43_0_0renderer/core/ConcreteComponentDescriptor.h>
  
  namespace ABI43_0_0facebook {
  namespace ABI43_0_0React {
  
  /*
   * Descriptor for <SafeAreaView> component.
   */
  class SafeAreaViewComponentDescriptor final
      : public ConcreteComponentDescriptor<SafeAreaViewShadowNode> {
    using ConcreteComponentDescriptor::ConcreteComponentDescriptor;
    void adopt(UnsharedShadowNode shadowNode) const override {
      assert(std::dynamic_pointer_cast<SafeAreaViewShadowNode>(shadowNode));
      auto safeAreaViewShadowNode =
          std::static_pointer_cast<SafeAreaViewShadowNode>(shadowNode);
  
      assert(std::dynamic_pointer_cast<YogaLayoutableShadowNode>(
          safeAreaViewShadowNode));
      auto layoutableShadowNode =
          std::static_pointer_cast<YogaLayoutableShadowNode>(
              safeAreaViewShadowNode);
  
      auto state =
          std::static_pointer_cast<const SafeAreaViewShadowNode::ConcreteState>(
              shadowNode->getState());
      auto stateData = state->getData();
  
      layoutableShadowNode->setPadding(stateData.padding);
  
      ConcreteComponentDescriptor::adopt(shadowNode);
    }
  };
  
  } // namespace ABI43_0_0React
  } // namespace ABI43_0_0facebook
  