WIP: Rearrange code

This commit is contained in:
aditya.chandel
2025-01-12 13:38:57 -07:00
parent 7df0052036
commit ef3556cb0c
77 changed files with 101 additions and 115 deletions
@@ -0,0 +1,47 @@
import {Component} from '@angular/core';
import {LibraryCreatorComponent} from '../../../book/components/library-creator/library-creator.component';
import {DialogService, DynamicDialogRef} from 'primeng/dynamicdialog';
import {LibraryService} from '../../../book/service/library.service';
import {Observable} from 'rxjs';
import {map} from 'rxjs/operators';
import {Button} from 'primeng/button';
import {AsyncPipe, NgIf} from '@angular/common';
import {DashboardScrollerComponent} from '../dashboard-scroller/dashboard-scroller.component';
@Component({
selector: 'app-main-dashboard',
templateUrl: './main-dashboard.component.html',
styleUrls: ['./main-dashboard.component.scss'],
imports: [
Button,
NgIf,
DashboardScrollerComponent,
AsyncPipe
],
providers: [DialogService],
})
export class MainDashboardComponent {
isLibrariesEmpty$: Observable<boolean>;
ref: DynamicDialogRef | undefined;
constructor(private libraryService: LibraryService, public dialogService: DialogService) {
this.isLibrariesEmpty$ = this.libraryService.libraryState$.pipe(
map(state => !state.libraries || state.libraries.length === 0)
);
}
createNewLibrary() {
this.ref = this.dialogService.open(LibraryCreatorComponent, {
header: 'Create New Library',
modal: true,
closable: true,
width: '675px',
height: '480px',
style: {
position: 'absolute',
top: '15%',
}
});
}
}