// React/Component imports import { useEffect, useState } from "react"; import DateSelector from './DateSelector.js'; // CSS imports import '../css/Route.css'; /** * The component that hold the forms for routing. * @param {Object} props */ function TimeSelector(props) { const [current, setCurrent] = useState(""); const toValue = date => new Date(date).toISOString().slice(0, 10); const [startDate, setStartDate] = useState(props.dates.start); const [endDate, setEndDate] = useState(props.dates.end); const changeTimeframe = () => { props.setDates({ start: startDate, end: endDate }); } useEffect(() => setCurrent(""), [startDate, endDate]); // The div with the html elements for routing. return (