<section class="dialog">
    <div
        [translate]="filename ? 'overwrite-files-dialog.file-title' : 'overwrite-files-dialog.archive-title'"
        class="dialog-header heading-l"
    ></div>

    <div class="dialog-content">
        <p *ngIf="filename" [innerHTML]="'overwrite-files-dialog.file-question' | translate : { filename: filename }" class="mb-24"></p>
        <p *ngIf="!filename" [innerHTML]="'overwrite-files-dialog.archive-question' | translate" class="mb-24"></p>

        <form [formGroup]="form">
            <iqser-details-radio [options]="options" formControlName="option"></iqser-details-radio>

            <div *ngIf="filename" class="iqser-input-group mt-0">
                <mat-checkbox color="primary" formControlName="rememberChoice" name="primaryAttribute">
                    {{ 'overwrite-files-dialog.remember' | translate }}
                </mat-checkbox>
            </div>
        </form>
    </div>

    <div class="dialog-actions">
        <iqser-icon-button
            (action)="selectOption()"
            *ngIf="!filename"
            [disabled]="rememberChoice"
            [label]="'overwrite-files-dialog.options.proceed' | translate"
            [type]="iconButtonTypes.primary"
        ></iqser-icon-button>

        <ng-container *ngIf="filename">
            <iqser-icon-button
                (action)="selectOption()"
                *ngIf="filename"
                [disabled]="rememberChoice"
                [label]="'overwrite-files-dialog.options.current-files' | translate"
                [type]="iconButtonTypes.primary"
            ></iqser-icon-button>

            <iqser-icon-button
                (action)="selectOption(true)"
                *ngIf="filename"
                [label]="'overwrite-files-dialog.options.all-files' | translate"
                [type]="iconButtonTypes.dark"
            ></iqser-icon-button>
        </ng-container>

        <div (click)="cancel()" [translate]="'overwrite-files-dialog.options.cancel'" class="all-caps-label cancel"></div>
    </div>
</section>
