From a8bed34d176a1bf9d614e93a279e5f125ef8b84c Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Thu, 25 Jun 2026 18:19:58 -0300 Subject: [PATCH] refactor(media): centralize frontend media-type detection in lib/mediaType Mirror the backend App\Enums\Media\Type on the frontend so "is this an image/video/PDF?" has a single definition instead of being hand-written (type === 'x' || mime_type startsWith ...) across a dozen files. - add lib/mediaType.ts: MediaType union, classify(), fromMimeType(), fromExtension(), isImage/isVideo/isDocument/isGif, acceptAttribute() - route every MediaItem detection and every File-upload validator through it - fix MediaDropzone rendering a typeless image item (AI/Unsplash/Giphy) as a broken