Second frontend, written in Next.JS + Typescript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
606 B

  1. import React, { useContext, useEffect } from "react";
  2. import LogListContext from "../../hooks/LogListContext";
  3. export default function LogList() {
  4. const {headers, filter, updateFilter} = useContext(LogListContext);
  5. useEffect(() => {
  6. const timeout = setTimeout(() => {
  7. updateFilter({...filter, limit: 10});
  8. }, 3000);
  9. return () => clearTimeout(timeout);
  10. }, [updateFilter]);
  11. return (
  12. <>
  13. <ol>
  14. {headers.map(l => <li key={l.shortId}>{l.title || `${l.channelName}${l.date}`}</li>)}
  15. </ol>
  16. <pre>{JSON.stringify(filter, null, 4)}</pre>
  17. </>
  18. );
  19. }