import React, { useContext } from "react"; import { Heading, HStack, IconButton } from "@chakra-ui/react"; import { Icon } from "@iconify/react"; import { format } from "date-fns"; import { CalenderContext } from "../../contexts/CalenderContext"; const CalenderNav = (): JSX.Element => { const { selectedMonth, prevMonth, nextMonth } = useContext(CalenderContext); const currentMonth = format(selectedMonth, "LLLL uuuu"); return ( } onClick={() => prevMonth()} /> {currentMonth} } onClick={() => nextMonth()} /> ); }; export default CalenderNav;