import { BaseComponent } from '@/shared/modules/base/components/BaseComponent';
import { Locator } from '@playwright/test';

export class BookingUnitTypeList extends BaseComponent {
  async select(unitType: string): Promise<void> {
    await this.getUnitTypeCard(unitType).click();
  }

  private getUnitTypeCard(item: string): Locator {
    return this.host.locator(
      `[data-test-id=unit-type-card]:has([data-test-id=unit-type-card-title]:text-is("${item}"))`
    );
  }
}
