import LeftArrowIcon from '@/assets/icons/left-arrow.svg' import RightArrowIcon from '@/assets/icons/right-arrow.svg' import { useEffect, useState } from 'react' import { getCalendarDates, getL10Weekday } from '../utils' export default () => { const [currentMonth, setCurrentMonth] = useState(new Date().getMonth()) const [currentYear, setCurrentYear] = useState(new Date().getFullYear()) const [selectedDate, setSelectedDate] = useState(new Date()) const [dates, setDates] = useState([]) const [l10nDays, setL10nDays] = useState(getL10Weekday()) useEffect(() => { setDates(getCalendarDates(currentMonth, currentYear)) }, [currentMonth, currentYear]) useEffect(() => { setCurrentMonth(selectedDate.getMonth()) setCurrentYear(selectedDate.getFullYear()) }, [selectedDate]) return (
{l10nDays.map(day =>
{day}
)} {dates.map(date => )}
) }