Refactors admin page design to move each 'facet' of admin into its own component.

This commit is contained in:
2026-07-10 01:14:30 -07:00
parent a4093e86b1
commit c02c0cdde9
30 changed files with 1970 additions and 1757 deletions
+45
View File
@@ -0,0 +1,45 @@
import { Component, inject, output } from '@angular/core';
import { CommonModule } from '@angular/common';
import { firstValueFrom } from 'rxjs';
import { TeamMember } from '../interfaces/team-member';
import { TeamMemberService } from '../services/team-member.service';
@Component({
selector: 'app-admin-team-tab',
standalone: true,
imports: [CommonModule],
templateUrl: './admin-team-tab.component.html',
styleUrl: './admin-team-tab.component.scss',
})
export class AdminTeamTabComponent {
private teamMemberService = inject(TeamMemberService);
readonly openForm = output<void>();
readonly editItem = output<TeamMember>();
readonly deleteItem = output<number>();
readonly members$ = this.teamMemberService.getTeamMembers();
ngOnInit(): void {
this.load();
}
async load(): Promise<void> {
await firstValueFrom(this.teamMemberService.getTeamMembers());
}
onAdd(): void {
this.openForm.emit();
}
onEdit(member: TeamMember): void {
this.editItem.emit(member);
}
async onDelete(id: number): Promise<void> {
if (!confirm('Delete this team member?')) return;
await firstValueFrom(this.teamMemberService.deleteTeamMember(id));
await this.load();
}
}