// pages-my-space.ts
import { Component } from '@angular/core';
import { Router } from '@angular/router';

@Component({
  selector: 'app-pages-my-space',
  imports: [],
  templateUrl: './pages-my-space.html',
  styleUrl: './pages-my-space.scss'
})
export class PagesMySpace {
  isLoading = false;
  activeMenu: string | null = null;

  constructor(private router: Router) {}

  async navigateTo(route: string) {
    this.isLoading = true;
    this.activeMenu = route;
    
    try {
      // 模拟网络延迟
      await new Promise(resolve => setTimeout(resolve, 300));
      
      // 在实际应用中，你可以使用:
      // this.router.navigate([route]);
      
      console.log(`Navigate to ${route}`);
    } finally {
      this.isLoading = false;
    }
  }

  showMyDesigns() {
    this.navigateTo('my-designs');
  }

  showTryOnHistory() {
    this.navigateTo('fitting-history');
  }

  showOrders() {
    this.navigateTo('order-management');
  }

  showCollections() {
    this.navigateTo('collections');
  }

  showFollowers() {
    this.navigateTo('followers');
  }

  showSettings() {
    this.navigateTo('settings');
  }
}