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

        <div class="dialog-content redaction">
            <div class="iqser-input-group w-450">
                <label class="selected-text" [translate]="'add-hint.dialog.content.selected-text'"></label>
                {{ form.get('selectedText').value }}
            </div>

            <iqser-details-radio
                [options]="options"
                (extraOptionChanged)="extraOptionChanged($event)"
                formControlName="option"
            ></iqser-details-radio>

            <ng-container *deny="roles.getRss">
                <div class="iqser-input-group required w-450">
                    <label [translate]="'add-hint.dialog.content.type'"></label>

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

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

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

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

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