"use client"; import { useEffect, useState } from "react"; import { Button } from "@/components/ui/button"; import { Download } from "lucide-react"; import Link from "next/link"; import ReactMarkdown from "react-markdown"; import { CHANGE_LOGS } from "@/constants/guidelines"; import { Skeleton } from "@/components/ui/skeleton"; interface Bullet { point: string; } interface LOGS { _id: string; date: string; version: string; bullets?: Bullet[]; // Make bullets optional } const LogsPage: React.FC = () => { const [downloads, setDownloads] = useState([]); const [error, setError] = useState(""); const [loading, setLoading] = useState(true); const fetchDownloads = async () => { try { const response = await fetch("/api/logs", { method: "GET", }); if (response.ok) { const data: LOGS[] = await response.json(); setDownloads(data); } else { throw new Error(`HTTP error! status: ${response.status}`); } } catch (error: any) { setError(error.message || "Failed to fetch downloads"); } finally { setLoading(false); } }; useEffect(() => { fetchDownloads(); const interval = setInterval(() => { fetchDownloads(); }, 10000); return () => clearInterval(interval); }, []); const reversedDownloads = [...downloads].reverse(); if (loading) { return ( <> Change Logs - SVRJS
); } return (

Server LOGS

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

{error &&

{error}

} {reversedDownloads.map((download) => (

{download.version}

{download.date}
    {(download.bullets ?? []).map((bullet, index) => (
  • {bullet.point}
  • ))}
))}
{CHANGE_LOGS}
); }; export default LogsPage;