<section class="dialog">
    <form (submit)="save()" [formGroup]="form">
        <div [translate]="'add-annotation.dialog.title'" class="dialog-header heading-l"></div>

        <div class="dialog-content redaction">
            <div class="iqser-input-group w-450">
                <label [translate]="'add-annotation.dialog.content.selected-text'" class="selected-text"></label>
                <span [innerHTML]="form.controls.selectedText.value"></span>
            </div>

            <div class="iqser-input-group required w-450">
                <label [translate]="'add-annotation.dialog.content.type'"></label>

                <mat-form-field>
                    <mat-select [placeholder]="'add-annotation.dialog.content.type-placeholder' | translate" formControlName="dictionary">
                        <mat-select-trigger>{{ displayedDictionaryLabel }}</mat-select-trigger>
                        <mat-option
                            *ngFor="let dictionary of dictionaries"
                            [matTooltip]="dictionary.description"
                            [value]="dictionary.type"
                            matTooltipPosition="after"
                        >
                            <span> {{ dictionary.label }} </span>
                        </mat-option>
                    </mat-select>
                </mat-form-field>
            </div>

            <div class="iqser-input-group w-450">
                <label [translate]="'add-annotation.dialog.content.comment'"></label>
                <textarea
                    [placeholder]="'add-annotation.dialog.content.comment-placeholder' | translate"
                    formControlName="comment"
                    iqserHasScrollbar
                    name="comment"
                    rows="4"
                    type="text"
                ></textarea>
            </div>
        </div>

        <div class="dialog-actions">
            <iqser-icon-button
                [disabled]="disabled"
                [label]="'add-annotation.dialog.actions.save' | translate"
                [submit]="true"
                [type]="iconButtonTypes.primary"
            ></iqser-icon-button>

            <div [translate]="'add-annotation.dialog.actions.cancel'" class="all-caps-label cancel" mat-dialog-close></div>
        </div>
    </form>

    <iqser-circle-button (action)="close()" class="dialog-close" icon="iqser:close"></iqser-circle-button>
</section>
