import { AutoHeightContainer } from "../PublicSector/AutoHeightContainer";
import { getStyleMap } from "@/utils/getStyleMap";
import { useMemo } from "react";
import { ImageProps } from "./interface";

export const Image = ({
  context,
  imageUrl,
  isClassTrue = true,
  trueClasses = [],
  alternativeText,
  displayname,
  objectfit,
  falseClasses = []
}: ImageProps) => {
  const style = useMemo(() => {
    return getStyleMap(trueClasses, falseClasses, isClassTrue, context);
  }, [trueClasses, falseClasses, isClassTrue, context]);
  return (
      <img
        css={style}
        src={imageUrl}
        alt={alternativeText || displayname}
        style={{
   
          
           overflow:"hidden",
           objectFit: objectfit 
          }}
      />
  );
};
