#ifdef RCT_NEW_ARCH_ENABLED

#import <React/RCTParagraphComponentView.h>
#import <react/renderer/components/text/ParagraphProps.h>
#import "ContentsquareModule/Contentsquare-Swift.h"

using namespace facebook::react;

@implementation RCTParagraphComponentView (CSQViewTextProvider)

- (NSDictionary *)csqGetAdditionalTextInformation {
    auto paragraphProps = std::dynamic_pointer_cast<const facebook::react::ParagraphProps>(_props);
    if (paragraphProps) {
        const auto maxLines = paragraphProps->paragraphAttributes.maximumNumberOfLines;
        const auto alignment = paragraphProps->textAttributes.alignment;
        
        return @{
                    @"maximumNumberOfLines": @(maxLines),
                    @"alignment": alignment.has_value() ? @(static_cast<int>(alignment.value())) : [NSNull null]
                };
    }
    return nil;
}

@end

#endif
