feat: add custom file input for images

This commit is contained in:
2026-02-07 23:00:12 -03:00
parent e803c670f4
commit 2c172dd3d1
4 changed files with 160 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
@if (imgUrl()) {
<div class="image-preview__container">
<img [src]="imgUrl()" [alt]="fileName()" width="300" height="300" />
</div>
}
<input
(change)="onFileSelected($event)"
#fileUpload
accept=".jpeg, .jpg, .png, .webp, .gif"
class="file-input"
type="file"
/>
<div class="file-upload">
<div class="file-upload__description" title="{{ fileName() }}">
{{ fileName() || 'common.no_file_yet' | translate | upperfirst }}
</div>
<button matMiniFab color="primary" class="upload-btn" (click)="fileUpload.click()">
<mat-icon>attach_file</mat-icon>
</button>
</div>