import React, {useState} from "react"
import useAuthUser from "../hooks/AuthUser"
import ToDoStore from "../components/toDos/ToDoStore"
import ToDoIndex from "../components/toDos/ToDoIndex"
import ToDoFinish from "../components/toDos/ToDoFinish"

const Home = () => {

    const {authUser} = useAuthUser()
    const [reload, setReload] = useState<Date|null>(null)

    return <div>
        {authUser &&
            <div className="px-5 pt-10">
                <ToDoStore setReload={setReload} />
                <ToDoIndex reload={reload} setReload={setReload} />
                <ToDoFinish reload={reload} />
            </div>
        }
    </div>
}

export default Home
