Download web/context/datasets-context.tsx from ZHZ1024/dify: direct link, hf CLI and curl.
- Browser
- Download file 486 Bytes
-
https://huggingface.co/spaces/ZHZ1024/dify/resolve/main/web/context/datasets-context.tsx
- Command line
-
hf download hf://spaces/ZHZ1024/dify/web/context/datasets-context.tsx
-
curl -L -o datasets-context.tsx https://huggingface.co/spaces/ZHZ1024/dify/resolve/main/web/context/datasets-context.tsx
486 Bytes
| '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 | |