This repository has been archived by the owner on May 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from tipisai/beta
fix: upload store problem
- Loading branch information
Showing
10 changed files
with
130 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
apps/agent/src/page/WorkSpace/AI/AIAgent/components/UploadContext/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { FC, createContext, useRef } from "react" | ||
import { UploadFileStore } from "@/utils/drive" | ||
import { | ||
IUploadContextInjectProps, | ||
IUploadContextProviderProps, | ||
} from "./interface" | ||
|
||
export const UploadContext = createContext({} as IUploadContextInjectProps) | ||
|
||
export const UploadContextProvider: FC<IUploadContextProviderProps> = ( | ||
props, | ||
) => { | ||
const uploadFileStore = useRef(new UploadFileStore()) | ||
return ( | ||
<UploadContext.Provider | ||
value={{ | ||
uploadFileStore: uploadFileStore.current, | ||
}} | ||
> | ||
{props.children} | ||
</UploadContext.Provider> | ||
) | ||
} |
10 changes: 10 additions & 0 deletions
10
apps/agent/src/page/WorkSpace/AI/AIAgent/components/UploadContext/interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ReactNode } from "react" | ||
import { UploadFileStore } from "@/utils/drive" | ||
|
||
export interface IUploadContextInjectProps { | ||
uploadFileStore: UploadFileStore | ||
} | ||
|
||
export interface IUploadContextProviderProps { | ||
children: ReactNode | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.