import { Component, Prop } from 'vue-property-decorator';
import { mixins } from 'vue-class-component';
import { WidgetWrapper } from '@devsun/form-generator/dist';
import { FormGeneratorNode } from '@devsun/form-generator';

@Component({})
export default class InfoBanner extends mixins(WidgetWrapper) {
  @Prop() fieldNode: FormGeneratorNode;
  @Prop() icon: string;
  @Prop({
    default: 'grey-banner',
    validator: (val: string) => ['grey-banner', 'yellow-banner'].includes(val),
  })
  variant: string;

  get label(): string {
    return this?.fieldNode?.rawAttrs?.label || '';
  }
}
