import { createContext, Dispatch, RefObject, SetStateAction } from 'react'

import { LayerModel } from '@/graphql'

import { GridSizeType, LayoutsType, ProjectData } from '@/types'

export type ProjectContextProps = {
	project: ProjectData
	//
	layer: LayerModel | undefined
	setLayer: Dispatch<SetStateAction<LayerModel | undefined>>
	//
	layouts: LayoutsType
	setLayouts: Dispatch<SetStateAction<LayoutsType>>
	//
	tempLayouts: LayoutsType
	setTempLayouts: Dispatch<SetStateAction<LayoutsType>>
	// 
	isEdit: boolean
	setIsEdit: Dispatch<SetStateAction<boolean>>
	//
	gridKey: number
	setGridKey: Dispatch<SetStateAction<number>>
	//
	gridSize: GridSizeType
	setGridSize: Dispatch<SetStateAction<GridSizeType>>
	//
	saveHandler: () => void
	cancelHandler: () => void
}

export const ProjectContext = createContext<ProjectContextProps | null>(null)
