import { createMemo, createSignal } from "solid-js";
import Integration from "../data/integration";

const [integration, setIntegration] = createSignal(null);

function IntegrationView(props) {
  const title = createMemo(() =>
    integration && typeof integration === "function"
      ? integration().getName()
      : "Integration"
  );
  return (
    <div
      class={
        "d-flex flex-column overflow-hidden flex-fill px-3 pb-2 pt-3 " +
        props.class
      }
    >
      <span>Integration</span>
      <h1>{title}</h1>
    </div>
  );
}

IntegrationView.setIntegration = setIntegration;
export default IntegrationView;
