import { Component, h, Host, State } from "@stencil/core";
import { createMentornityApiInstance } from "src/modules/mentornity-js-client";
import { mentornityApiEndpoint } from "../../constants/env";
import { getSessionDetails } from "../../util/session";
export class MentornityHomeMessageWrapper {
  async componentWillLoad() {
    const { context, headers } = getSessionDetails();
    this.config = await createMentornityApiInstance(mentornityApiEndpoint, headers)
      .getOrganisationConfig(context.organisationId);
  }
  render() {
    const { config: { adminWebAppHomeMessage: { content } } } = this;
    return (h(Host, null,
      h("mentornity-root-wrapper", null,
        h("dvn-rich-content", { value: content }))));
  }
  static get is() { return "mentornity-home-message-wrapper"; }
  static get states() { return {
    "config": {}
  }; }
}
