You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 line
2.8KB

  1. <div class="chat-input-container" (drop)="onFileDrop($event)" (dragover)="onDragOver($event)">
  2. <div class="attached-files" *ngIf="attachedFiles.length > 0">
  3. <div class="file-item" *ngFor="let attachedFile of attachedFiles">
  4. <div class="file-preview">
  5. <img *ngIf="attachedFile.preview" [src]="attachedFile.preview" alt="Preview">
  6. <div class="file-icon" *ngIf="!attachedFile.preview" [innerHTML]="getFileIcon(attachedFile.file.type)">
  7. </div>
  8. </div>
  9. <div class="file-info">
  10. <span class="file-name">{{ attachedFile.file.name }}</span>
  11. <span class="file-size">{{ formatFileSize(attachedFile.file.size) }}</span>
  12. </div>
  13. <button class="remove-file-button" (click)="removeFile(attachedFile.id)" [attr.aria-label]="'Supprimer le fichier'">
  14. <fa-icon [icon]="faTimes"></fa-icon>
  15. </button>
  16. </div>
  17. </div>
  18. <div class="input-wrapper">
  19. <textarea
  20. #messageInput
  21. [(ngModel)]="message"
  22. placeholder="Nouvelle conversation..."
  23. rows="1"
  24. [disabled]="disabled"
  25. (input)="onInputChange()"
  26. ></textarea>
  27. <div class="actions-row">
  28. <button class="attach-button" (click)="onAttach()" [attr.aria-label]="'Importer un fichier'">
  29. <fa-icon [icon]="faPaperclip"></fa-icon>
  30. <span>Importer un fichier</span>
  31. </button>
  32. <div class="right-actions">
  33. <button class="voice-button" (click)="onVoice()" [attr.aria-label]="'Message vocal'">
  34. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-soundwave" viewBox="0 0 16 16">
  35. <path fill-rule="evenodd" d="M8.5 2a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-1 0v-11a.5.5 0 0 1 .5-.5m-2 2a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5m4 0a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5m-6 1.5A.5.5 0 0 1 5 6v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m8 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m-10 1A.5.5 0 0 1 3 7v2a.5.5 0 0 1-1 0V7a.5.5 0 0 1 .5-.5m12 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0V7a.5.5 0 0 1 .5-.5"/>
  36. </svg>
  37. </button>
  38. <button
  39. class="send-button"
  40. (click)="onSend()"
  41. [disabled]="(!message.trim() && attachedFiles.length === 0) || disabled"
  42. [attr.aria-label]="'Envoyer le message'"
  43. >
  44. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-up" viewBox="0 0 16 16">
  45. <path fill-rule="evenodd" d="M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5"/>
  46. </svg>
  47. </button>
  48. </div>
  49. </div>
  50. </div>
  51. <input
  52. #fileInput
  53. type="file"
  54. [accept]="acceptedFileTypes"
  55. [multiple]="true"
  56. (change)="onFileSelected($event)"
  57. style="display: none;"
  58. />
  59. </div>