From b61330cf98f822d25e3afc5f1984b9685c252cc3 Mon Sep 17 00:00:00 2001 From: alij Date: Thu, 29 Aug 2024 00:20:38 +0330 Subject: [PATCH] (feat) add description field web services in learn components --- .../tutorial/section/components/Leran.tsx | 43 ++++++++++++++----- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/src/pages/tutorial/section/components/Leran.tsx b/src/pages/tutorial/section/components/Leran.tsx index dd2070f..1636ac9 100644 --- a/src/pages/tutorial/section/components/Leran.tsx +++ b/src/pages/tutorial/section/components/Leran.tsx @@ -5,6 +5,7 @@ import Alert from "../../../../components/alert/Alert"; import { MdErrorOutline } from "react-icons/md"; import Button from "../../../../components/button"; import { saveAs } from "file-saver"; +import { Fragment } from "react/jsx-runtime"; const getMediaType = (url: string) => { const extension = url.split(".").pop()?.toLowerCase(); @@ -73,16 +74,38 @@ const Learn = ({ activeTutorial }: LearnProps) => { data?.data?.result?.files.length > 0 && (
{data.data.result.files.map( - (file: { id: number; title: string; file: string }) => ( -
-

{file.title}

- -
+ (file: { + id: number; + title: string; + file: string; + description: string; + }) => ( + + {file?.description ? ( +
+
+

{file.title}

+ +
+

توضیحات : {file?.description}

+
+ ) : ( +
+

{file.title}

+ +
+ )} +
) )}