import { ClockIcon } from "@heroicons/react/outline"; import { useRef } from "react"; export default function SetTimesModal(props) { const [startHours, startMinutes] = [Math.floor(props.startTime / 60), props.startTime % 60]; const [endHours, endMinutes] = [Math.floor(props.endTime / 60), props.endTime % 60]; const startHoursRef = useRef(); const startMinsRef = useRef(); const endHoursRef = useRef(); const endMinsRef = useRef(); function updateStartEndTimesHandler(event) { event.preventDefault(); const enteredStartHours = parseInt(startHoursRef.current.value); const enteredStartMins = parseInt(startMinsRef.current.value); const enteredEndHours = parseInt(endHoursRef.current.value); const enteredEndMins = parseInt(endMinsRef.current.value); props.onChange({ startTime: enteredStartHours * 60 + enteredStartMins, endTime: enteredEndHours * 60 + enteredEndMins, }); props.onExit(0); } return (

Set your work schedule

:
:
); }