import withToolTip from "../../../hoc/withToolTip";
import { ComprehensiveProps } from "../../DomainProps";

export interface HtmlProps extends ComprehensiveProps {}

const HtmlWidget = ({
  value,
  widgetStyle,
  id,
  onChange,
  onKeyDown,
  onKeyUp,
  onBlur,
  onClick,
  screenDataField,
}: HtmlProps) => {
  return (
    <div
      id={widgetStyle?.id || ""}
      className={widgetStyle?.className || ""}
      style={widgetStyle?.inline || {}}
      dangerouslySetInnerHTML={{ __html: value }}
      onClick={(event) => {
        if (onClick) onClick(null, screenDataField, event);
      }}
    />
  );
};

export default withToolTip(HtmlWidget);
