
<div mat-dialog-content>

  <div *ngIf="messages && messages.length === 0 && !result && hasError === false">
    <h3>Done executing file</h3>
    <p class="text-muted">
      Hyperlambda executed successfully without producing result
    </p>
  </div>

  <div *ngIf="!(messages && messages.length === 0 && !result && hasError === false)">
    <h3>Executing Hyperlambda</h3>
  </div>

  <div class="terminal" *ngIf="messages && messages.length > 0">
    <div *ngFor="let el of messages">
      <h2 class="mb-3">Action: {{el.name}}</h2>
      <h4 *ngIf="el.input" class="mt-4 mb-3">Input</h4>
      <pre *ngIf="el.input" class="args"><code [highlight]="el.input"></code></pre>
      <h4 *ngIf="el.output" class="mt-4 mb-3">Output</h4>
      <pre *ngIf="el.output" class="args"><code [highlight]="el.output"></code></pre>
      <div *ngIf="el.time">{{el.time}} seconds</div>
      <div *ngIf="el.error" class="error">{{el.error}}</div>
      <hr *ngIf="el !== messages[messages.length - 1]">
    </div>
  </div>

  <h3 *ngIf="result">Result</h3>
  <pre
    *ngIf="result"
    class="mb-2 result"
    [highlight]="result"></pre>

</div>

<div mat-dialog-actions [align]="'end'">

  <button
    *ngIf="result"
    mat-button
    (click)="copy()">
    Copy
  </button>

  <button
    mat-flat-button
    color="primary"
    mat-dialog-close>
    Close
  </button>

</div>