34 lines
963 B
TypeScript
34 lines
963 B
TypeScript
import { Component, inject } from '@angular/core';
|
|
import { Router } from "@angular/router";
|
|
import { CommonModule } from "@angular/common";
|
|
|
|
export interface Discussion {
|
|
id: number;
|
|
name: string;
|
|
isGroup: boolean;
|
|
membersCount?: number;
|
|
}
|
|
|
|
@Component({
|
|
selector: 'app-menu-users',
|
|
imports: [CommonModule],
|
|
templateUrl: './menu-users.component.html',
|
|
styleUrl: './menu-users.component.css'
|
|
})
|
|
export class MenuUsersComponent {
|
|
|
|
private router = inject(Router);
|
|
|
|
discussions: Discussion[] = [
|
|
{ id: 1, name: 'Um-Bro', isGroup: false },
|
|
{ id: 2, name: 'Doggeybag', isGroup: false },
|
|
{ id: 3, name: '', isGroup: false },
|
|
{ id: 4, name: 'Abel Paradigm', isGroup: false },
|
|
{ id: 5, name: 'Um-Brothers', isGroup: true, membersCount: 7 },
|
|
{ id: 6, name: 'Hoodie G', isGroup: false },
|
|
];
|
|
|
|
openDiscussion(discussionId: number) {
|
|
this.router.navigate(['/main/messages', discussionId]);
|
|
}
|
|
} |