From 05f0f80600474a8adffc0ce9f7d4b9b0f19c916e Mon Sep 17 00:00:00 2001 From: Alzalia Date: Sat, 6 Sep 2025 21:26:52 +0200 Subject: [PATCH] fix: download not working --- src/components/Card.tsx | 75 +++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 33 deletions(-) diff --git a/src/components/Card.tsx b/src/components/Card.tsx index 54e73ae..d0f94ca 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -10,6 +10,34 @@ interface Props { } export default function Card({ title, content, id, downloads }: Props) { + return ( +
+

+ {title} +

+
+ {content} +
+ {downloads != null ? ( +
+ Téléchargments +
    + {downloads.map((e, i) => ( + + ))} +
+
+ ) : null} +
+ ) +} + +interface DownloadProps { + e: CardDownloadType + i: number +} + +function Download({ e, i }: DownloadProps) { const [isDownloading, setIsDownloading] = useState(false) function download(path: URL, fileName = 'file') { @@ -37,38 +65,19 @@ export default function Card({ title, content, id, downloads }: Props) { } return ( -
-

- {title} -

-
- {content} -
- {downloads != null ? ( -
- Téléchargments -
    - {downloads.map((e, i) => ( -
  1. - download(e.link, e.filename)} - > - {isDownloading - ? '[Téléchargement en cours ...] ' - : null}{' '} - {e.title} - -
  2. - ))} -
-
- ) : null} -
+
  • + download(e.link, e.filename)} + > + {isDownloading ? '[Téléchargement en cours ...] ' : null}{' '} + {e.title} + +
  • ) }