'use client'
import React from "react";
import {TitleOperation} from "@/app/ui/task/TitleOperation";
import LocalContext from "@/app/ui/LocalContent";
import dayjs from "dayjs";

export default function Layout({children}: { children: React.ReactNode }) {
    const [taskState, setTaskState] = React.useState<string>('8,9')
    let expectStartTimeList=[];
    expectStartTimeList.push({'name':"expectedStartTime",'value':dayjs().subtract(7,'day'),'operateType':">="});
    expectStartTimeList.push({'name':"expectedStartTime",'value':dayjs().add(7,'day'),'operateType':"<"})
    const [expectedStartTime, setExpectedStartTime] = React.useState<string>(JSON.stringify(expectStartTimeList))
    return (
        <div>
            <TitleOperation setTaskState={setTaskState} setExpectedStartTime={setExpectedStartTime}/>
            <LocalContext.Provider value={{'taskState':taskState,'expectedStartTime':expectedStartTime}}>
                {children}
            </LocalContext.Provider>
            </div>
    );
}
