import { Component, h } from "atomico";
import style from "./custom-element.css";
import { getComponentOrDefine } from "../../hooks/aync-hook/redirect";

const CustomElement: Component = ({ message }) => (
  <host shadowDom>
    <style>{style}</style>
    <div>
      {message}
    </div>
  </host>
);

CustomElement.props = {
  message: {
    type: String,
    value: "custom-element",
    reflect: true,
    event: {
      type: "changeMessage",
    },
  },
};

export default getComponentOrDefine("custom-element", CustomElement);
