import { TuiInputPasswordModule } from '@taiga-ui/legacy' import { Component, inject } from '@angular/core' import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms' import * as argon2 from '@start9labs/argon2' import { ErrorService } from '@start9labs/shared' import { TuiDialogContext, TuiError, TuiButton } from '@taiga-ui/core' import { POLYMORPHEUS_CONTEXT, PolymorpheusComponent, } from '@taiga-ui/polymorpheus' interface DialogData { passwordHash?: string storageDrive?: boolean } @Component({ standalone: true, template: ` @if (storageDrive) { Choose a password for your server. Make it good. Write it down. } @else { Enter the password that was used to encrypt this drive. }
`, styles: ['footer { display: flex; gap: 1rem; margin-top: 1rem }'], imports: [ FormsModule, ReactiveFormsModule, TuiButton, TuiInputPasswordModule, TuiError, ], }) export class PasswordComponent { private readonly errorService = inject(ErrorService) private readonly context = inject