import React, { useEffect } from "react"; import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; import { useDispatch } from "react-redux"; import { actions, useTypedSelector } from "./store"; import { Link } from "react-router-dom"; import humanizeDuration from "humanize-duration"; import type { Task, Habit } from "./store"; const days = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", ]; const postItColor = "yellow"; const PostIt = (props: { day: number; tasks: Task[] }) => (

{days[props.day]}

{props.tasks.map((task) => (
  1. [{humanizeDuration(task.duration)}] {task.label}
))}
); const App: React.FC = () => { const dispatch = useDispatch(); const { isLoading, habits } = useTypedSelector((state) => ({ isLoading: state.isLoading, habits: state.habits, })); return (

Habits

    {habits.map((habit) => ( ))}
); }; export default App;