feat(dashboard): Improve error messages during file upload (#13991)

* feat(dashboard): Update error message for large files

Update error message for uploads of files that exceed their limit

Related https://github.com/medusajs/medusa/pull/13981

* Added changeset
This commit is contained in:
juanzgc
2025-11-06 14:41:07 -05:00
committed by GitHub
parent 01a5ce949e
commit 5a96bb7da4
3 changed files with 8 additions and 3 deletions
@@ -70,7 +70,7 @@ export const UploadMediaFormItem = ({
const fileSizeRejections = rejectedFiles.filter((f) => f?.reason === "size")
if (fileSizeRejections.length) {
const fileNames = fileSizeRejections.map((f) => f.file.name).join(", ")
const fileNames = "\n" + fileSizeRejections.slice(0, 5).map((f) => f.file.name).join("\n")
form.setError("media", {
type: "file_too_large",
message: t("products.media.fileTooLarge", {
@@ -124,7 +124,7 @@ export const UploadMediaFormItem = ({
onUploaded={onUploaded}
/>
</Form.Control>
<Form.ErrorMessage />
<Form.ErrorMessage className="whitespace-pre-line" />
</div>
</Form.Item>
)