import { AbstractComponentBuilder } from './AbstractComponentBuilder'; export class FacesRatingBarComponentBuilder extends AbstractComponentBuilder<'FacesRatingBar'> { constructor(id: string) { super(id, 'FacesRatingBar'); } setTooltips(tooltips: [string, string, string, string, string]) { this.patch({ tooltips, }); return this; } override isValid() { const { tooltips } = this.state(); const validation = this.createValidationResponse().withParentValidation( super.isValid(), ); if (tooltips?.length) { validation.withCheck('should be exactly 5 tooltips', () => { return tooltips?.length === 5; }); } return validation.validate(); } }