Hey,
You should return a DomConfig object, and to render correctly in this case (matching the button structure), you should have something like this:
class CustomButton extends Button {
static get type() {
return "custom-button"
}
compose() {
if (this.metadata?.status === "Template") {
return {
style: "display: none"
};
} else if (this.metadata?.status != null) {
const text = this.metadata?.status === "Draft" ? "Mark Live" : "Mark Draft";
return {
tag: 'button',
children: [
{
tag: 'label',
text,
}
]
}
}
}
}