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 (
-
+
+ download(e.link, e.filename)}
+ >
+ {isDownloading ? '[Téléchargement en cours ...] ' : null}{' '}
+ {e.title}
+
+
)
}