File size: 486 Bytes
a8b3f00 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
'use client'
import { createContext, useContext } from 'use-context-selector'
import type { DataSet } from '@/models/datasets'
export type DatasetsContextValue = {
datasets: DataSet[]
mutateDatasets: () => void
currentDataset?: DataSet
}
const DatasetsContext = createContext<DatasetsContextValue>({
datasets: [],
mutateDatasets: () => {},
currentDataset: undefined,
})
export const useDatasetsContext = () => useContext(DatasetsContext)
export default DatasetsContext
|