import React, {useState} from 'react';
import dayjs from "dayjs";
import locale from "dayjs/locale/el";
import CalendarMonth from "./CalendarMonth";


type CalendarMonthSingleProps = {
   getEvents?: (p:any) => any
}


/***
 * Generates Calendar month with controls for changing month
 */
const CalendarMonthSingle = ({getEvents}: CalendarMonthSingleProps) => {

    const now = dayjs().locale({
        ...locale,
    });




    const [month, setMonth] = useState(now)


    return (
        <CalendarMonth
        month={month}
        hasControl={true}
        prevMonth={()=>setMonth(month.add(-1, 'month'))}
        nextMonth={()=>setMonth(month.add(1, 'month'))}
        getEvents={getEvents}
        />
    );
}

export default CalendarMonthSingle;