Initial commit
This commit is contained in:
commit
db896255d6
744 changed files with 56028 additions and 0 deletions
20
web/context/datasets-context.tsx
Normal file
20
web/context/datasets-context.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
'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
|
||||
Loading…
Add table
Add a link
Reference in a new issue