import React from 'react'; import ReactDOM from 'react-dom'; import './style.css'; import './fonts/Bitter-Regular.woff'; import useLocalStorage from './hooks/useLocalStorage'; import Timer from './components/Timer'; interface Solution { result: string; timestamp: string; author?: string; } const App: React.FC = () => { const [author, setAuthor] = useLocalStorage('author', 'anonymous'); const [solutions, setSolutions] = useLocalStorage('solutions', []); const registerResult = (result: string) => { setSolutions([{ author, result, timestamp: new Date().toISOString() }, ...solutions]); } const removeSolution = (index: number) => { setSolutions(solutions.filter((_, i) => i !== index)); } return ( <>

Timer

Results

{solutions.map((solution, index) => ( ))}
Author Result Timestamp Actions
{solution.author} {solution.result} {new Date(solution.timestamp).toLocaleString()}
); }; ReactDOM.render(, document.getElementById('root'));