From 1ea325ad4731a766d1befe20cc0e8574554507a9 Mon Sep 17 00:00:00 2001 From: soheil khaledabadi Date: Fri, 4 Sep 2026 18:02:08 +0330 Subject: [PATCH] fix: show missing tutorial file download, support more video formats - Render the download button for a tutorial's uploaded file field (it was fetched from the API but never displayed). - Recognize mov/avi/wmv as video (the backend already accepts them as uploads) and add a download fallback for any media type the browser can't play inline instead of a dead "unknown file type" message. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01KMLvfLviDB12t4U9UijE4k --- .../tutorial/section/components/Leran.tsx | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/pages/tutorial/section/components/Leran.tsx b/src/pages/tutorial/section/components/Leran.tsx index 1636ac9..7597a0f 100644 --- a/src/pages/tutorial/section/components/Leran.tsx +++ b/src/pages/tutorial/section/components/Leran.tsx @@ -13,7 +13,7 @@ const getMediaType = (url: string) => { if (["jpg", "jpeg", "png", "gif"].includes(extension)) { return "image"; } - if (["mp4", "webm", "ogg"].includes(extension)) { + if (["mp4", "webm", "ogg", "mov", "avi", "wmv"].includes(extension)) { return "video"; } } @@ -117,6 +117,7 @@ const Learn = ({ activeTutorial }: LearnProps) => { id: string; title: string; medias: string[]; + file: string | null; url_file: string; }) => (
{ className="w-full h-full object-cover rounded-lg" /> ) : mediaType === "video" ? ( -
); })} + {i.file && ( + + )} {i.url_file && ( <>