import { AutoHeightContainer } from "../PublicSector/AutoHeightContainer";
import { getStyleMap } from "@/utils/getStyleMap";
import { useMemo } from "react";
import { ImageProps } from "./interface";
import { Image, Platform, SafeAreaView, StyleSheet } from 'react-native';
import React from "react";
import { View, Text } from "react-native"
import { SafeAreaProvider } from "react-native-safe-area-context";

export const ImageNative = ({
  context,
  imageUrl,
  isClassTrue = true,
  trueClasses = [],
  alternativeText,
  displayname,
  objectfit,
  falseClasses = [],
  updateComponentHeight,
}: ImageProps) => {
  const styles = useMemo(() => {
    return getStyleMap(trueClasses, falseClasses, isClassTrue, context);
  }, [trueClasses, falseClasses, isClassTrue, context]);
  const flattenedStyles = Array.isArray(styles)
    ? styles.flat().reduce((merged, styleObj) => ({ ...merged, ...styleObj }), {})
    : styles || {};
  return (
 
    <View
    >
    
       <Image
        // style={styles.tinyLogo}
        style={{ height: 100, width: 100, ...flattenedStyles }}
        // style={{ ...flattenedStyles }}
        // source={require('@assets/act21LogoPng.png')}
        source={{
          uri:  imageUrl,
        }}
      />
     
    </View>

  );
};
