/** * @copyright nhcarrigan * @license Naomi's Public License * @author Naomi Carrigan */ "use client"; import { type JSX, useEffect, useState } from "react"; import { Activity } from "../../components/activity"; import { Rule } from "../../components/rule"; /** * Renders the /activity page. * @returns A React Component. */ const ActivityComponent = (): JSX.Element => { const [ activity, setActivity ] = useState< Array<{ type: string; date: Date; repo: string; repoName: string; }> >([]); useEffect(() => { void fetch("/api/activity"). then(async(data) => { // eslint-disable-next-line @typescript-eslint/consistent-type-assertions return (await data.json()) as Array<{ type: string; date: Date; repo: string; repoName: string; }>; }). then((data) => { setActivity(data); }); }, []); return (

{`Recent Activity`}

{`See what Naomi has been up to lately.`}

    {activity.map((act, index) => { return ( ); })}
); }; export default ActivityComponent;