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.
24 lines
606 B
24 lines
606 B
import React, { useContext, useEffect } from "react";
|
|
|
|
import LogListContext from "../../hooks/LogListContext";
|
|
|
|
export default function LogList() {
|
|
const {headers, filter, updateFilter} = useContext(LogListContext);
|
|
|
|
useEffect(() => {
|
|
const timeout = setTimeout(() => {
|
|
updateFilter({...filter, limit: 10});
|
|
}, 3000);
|
|
|
|
return () => clearTimeout(timeout);
|
|
}, [updateFilter]);
|
|
|
|
return (
|
|
<>
|
|
<ol>
|
|
{headers.map(l => <li key={l.shortId}>{l.title || `${l.channelName} — ${l.date}`}</li>)}
|
|
</ol>
|
|
<pre>{JSON.stringify(filter, null, 4)}</pre>
|
|
</>
|
|
);
|
|
}
|