From d8da7e2a05b93a1c7b48dcd6189ab8dbe6a1a2d9 Mon Sep 17 00:00:00 2001 From: killer-cf Date: Fri, 14 Nov 2025 21:55:28 -0300 Subject: [PATCH] refactor: enhance FileUpload component with improved error handling and UI updates - Refactored the FileUpload component to improve code readability and maintainability. - Enhanced error handling during file upload and removal processes, providing clearer feedback to users. - Updated UI elements for better alignment and consistency, including file type previews and action buttons. - Integrated the resolve function for help URLs to ensure proper linking. - Streamlined file validation logic for size and type checks, improving user experience. --- apps/web/src/lib/components/FileUpload.svelte | 437 +++++++++--------- 1 file changed, 228 insertions(+), 209 deletions(-) diff --git a/apps/web/src/lib/components/FileUpload.svelte b/apps/web/src/lib/components/FileUpload.svelte index f02260a..1e7768e 100644 --- a/apps/web/src/lib/components/FileUpload.svelte +++ b/apps/web/src/lib/components/FileUpload.svelte @@ -1,74 +1,74 @@
- + - + {#if value || fileName}
@@ -194,78 +213,78 @@
{:else}
- +
{/if}
- -
-

- {fileName || "Arquivo anexado"} -

-

- {#if uploading} - Carregando... - {:else} - Enviado com sucesso - {/if} -

-
+ +
+

+ {fileName || 'Arquivo anexado'} +

+

+ {#if uploading} + Carregando... + {:else} + Enviado com sucesso + {/if} +

+
- -
- {#if fileUrl} - - {/if} - - -
- - {:else} - - {/if} + +
+ {#if fileUrl} + + {/if} + + +
+ + {:else} + + {/if} - {#if error} -
- {error} -
- {/if} + {#if error} +
+ {error} +
+ {/if}