// Example from https://beta.reactjs.org/learn import React, { useState, useEffect } from "react"; import styles from './changelog.module.css' function dateformate(date){ const event = new Date(date) return event.toDateString() } function ChangeLog() { const [books, setBooks] = useState(null); useEffect(() => { getData(); async function getData() { try { const response = await fetch( "https://api.github.com/repos/kalanakt/All-Url-Uploader/commits" ); const data = await response.json(); setBooks(data); } catch (error) { console.log(error); } } }, []); return (
{books ? (
{books.map((book: { commit: { message: string | number | boolean | React.ReactElement> | React.ReactFragment | React.ReactPortal; author: { date: string | number | boolean | React.ReactElement> | React.ReactFragment | React.ReactPortal; }; comment_count: string | number | boolean | React.ReactElement> | React.ReactFragment | React.ReactPortal; verification: { verified: string | number | boolean | React.ReactElement> | React.ReactFragment | React.ReactPortal; }; }; html_url: string; comments_url: string; author: { [x: string]: string; login: string; avatar_url: string; }; }, index: React.Key) => { return (

1.0.4 ({dateformate(book.commit.author.date)})

{book.commit.verification.verified ? Success : Fail}
Committer : github icon
Comments : {book.commit.comment_count}
); })}
) : ( 404 : Page Not Found )}
) } export default function MyApp() { return }