import React from 'react' import { Dispatch, SetStateAction, createContext, useState } from 'react' import { SelectionType } from '../types' export const SelectionsContext = createContext<{ selections: Record setSelections: Dispatch>> } | null>(null) type SelectionProviderType = { // selections:SelectionType[], children: React.ReactNode } export const SelectionProvider = ({ children }: SelectionProviderType) => { const [selections, setSelections] = useState>({}) const value = { selections, setSelections } return {children} }