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

import { ColumnInput } from '@/graphql'

import { IDatasetFileInfo, IFileInfo } from '@/types'

export type CreateDatasetContextProps = {
	name: string
	setName: Dispatch<SetStateAction<string>>
	//
	sourceType: string
	setSourceType: Dispatch<SetStateAction<string>>
	//
	fileInfo: IFileInfo | null
	setFileInfo: Dispatch<SetStateAction<IFileInfo | null>>
	//
	datasetFileInfo: IDatasetFileInfo
	setDatasetFileInfo: Dispatch<SetStateAction<IDatasetFileInfo>>
	//
	columns: ColumnInput[]
	setColumns: Dispatch<SetStateAction<ColumnInput[]>>
}

export const CreateDatasetContext =
	createContext<CreateDatasetContextProps | null>(null)
