"use client"; import { useEffect, useState } from "react"; import { Button } from "@/components/ui/button"; import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { Download } from "lucide-react"; import Link from "next/link"; import { Skeleton } from "@/components/ui/skeleton"; interface Download { _id: string; date: string; fileName: string; version: string; fileSize: string; downloadLink?: string; // Optional } const DownloadPage: React.FC = () => { const [downloads, setDownloads] = useState([]); const [error, setError] = useState(""); const fetchDownloads = async () => { try { const response = await fetch("/api/downloads", { method: "GET" }); if (response.ok) { const data: Download[] = await response.json(); setDownloads(data); } else { throw new Error(`HTTP error! status: ${response.status}`); } } catch (error: any) { setError(error.message); } }; useEffect(() => { fetchDownloads(); const interval = setInterval(() => { fetchDownloads(); }, 10000); return () => clearInterval(interval); }, []); return (

Downloads

Get all the latest version of SVRJS download and compiled Files here!

{error &&

{error}

} A list of all available downloads. Date File Name Version File Size Download Link {downloads .slice(0, 10) .reverse() .map((download) => ( {download.date} {download.fileName} {download.version} {download.fileSize} {download.downloadLink ? ( ) : ( )} ))}
); }; export default DownloadPage;