Spaces:
Configuration error
Configuration error
Download frontend/src/hooks/query/use-list-file.ts from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 543 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/hooks/query/use-list-file.ts
- Command line
-
hf download hf://spaces/flyingdarkdev/README/frontend/src/hooks/query/use-list-file.ts
-
curl -L -o use-list-file.ts https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/hooks/query/use-list-file.ts
543 Bytes
| import { useQuery } from "@tanstack/react-query"; | |
| import OpenHands from "#/api/open-hands"; | |
| import { useConversation } from "#/context/conversation-context"; | |
| interface UseListFileConfig { | |
| path: string; | |
| } | |
| export const useListFile = (config: UseListFileConfig) => { | |
| const { conversationId } = useConversation(); | |
| return useQuery({ | |
| queryKey: ["file", conversationId, config.path], | |
| queryFn: () => OpenHands.getFile(conversationId, config.path), | |
| enabled: false, // don't fetch by default, trigger manually via `refetch` | |
| }); | |
| }; | |