import { Component, signal } from '@angular/core'; type Project = { id: number; name: string; owner: string; status: 'Actif' | 'En attente' | 'Nouveau'; progress: number; }; @Component({ selector: 'app-projects', imports: [], templateUrl: './projects.html', styleUrl: './projects.css', }) export class Projects { protected readonly projects = signal([ { id: 1, name: 'Refonte Interface', owner: 'Marie', status: 'Actif', progress: 70 }, { id: 2, name: 'API Inventaire', owner: 'Nabil', status: 'En attente', progress: 45 }, { id: 3, name: 'Pipeline CI', owner: 'Sonia', status: 'Actif', progress: 90 }, ]); private nextId = 4; protected createProject(): void { const newProject: Project = { id: this.nextId, name: `Nouveau projet ${this.nextId}`, owner: 'A definir', status: 'Nouveau', progress: 0, }; this.projects.update((currentProjects) => [...currentProjects, newProject]); this.nextId += 1; } }