import type { Page } from "@playwright/test";

export class UserProfilePage {
  private page: Page;
  constructor(page: Page) {
    this.page = page;
  }

  async goto() {
    await this.page.goto("/user-management/profile");
  }

  get heading() {
    return this.page.getByRole("heading", { name: "My Profile" });
  }

  get nameField() {
    return this.page.getByText(/name/i).first();
  }

  get emailField() {
    return this.page.getByText(/email/i).first();
  }

  get roleField() {
    return this.page.getByText(/role/i).first();
  }

  get statusField() {
    return this.page.getByText(/status/i).first();
  }

  get editButton() {
    return this.page.getByRole("link", { name: /edit/i });
  }
}
