import { Component, Input } from "@angular/core";
import { PrimaryButtonComponent } from "../primary-button/primary-button.component";
import { SecondaryButtonComponent } from "../secondary-button/secondary-button.component";
import { TextButtonComponent } from "../text-button/text-button.component";
@Component({
selector: "my-button",
templateUrl: "./my-button.component.html",
})
export class MyButtonComponent {
@Input() type: "primary" | "secondary" | "text" = "text";
get buttonComponentType() {
switch (this.type) {
case "primary":
return PrimaryButtonComponent;
case "secondary":
return SecondaryButtonComponent;
case "text":
default:
return TextButtonComponent;
}
}
}