mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-30 19:36:25 +02:00
refactor: replace useAuth with authenticatedFetch in OneDriveConfig and add OneDrive SVG icon
This commit is contained in:
parent
b42b3a0a9b
commit
40f086b6ed
2 changed files with 53 additions and 3 deletions
|
|
@ -25,7 +25,7 @@ import {
|
|||
} from "@/components/ui/select";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { useAuth } from "@/context/AuthContext";
|
||||
import { authenticatedFetch } from "@/lib/auth-utils";
|
||||
import type { ConnectorConfigProps } from "../index";
|
||||
|
||||
interface SelectedItem {
|
||||
|
|
@ -74,7 +74,6 @@ function getFileIconFromName(fileName: string, className = "size-3.5 shrink-0")
|
|||
}
|
||||
|
||||
export const OneDriveConfig: FC<ConnectorConfigProps> = ({ connector, onConfigChange }) => {
|
||||
const { authenticatedFetch } = useAuth();
|
||||
const existingFolders = (connector.config?.selected_folders as SelectedItem[] | undefined) || [];
|
||||
const existingFiles = (connector.config?.selected_files as SelectedItem[] | undefined) || [];
|
||||
const existingIndexingOptions =
|
||||
|
|
@ -137,7 +136,7 @@ export const OneDriveConfig: FC<ConnectorConfigProps> = ({ connector, onConfigCh
|
|||
setBrowseLoading(false);
|
||||
}
|
||||
},
|
||||
[connector.id, authenticatedFetch],
|
||||
[connector.id],
|
||||
);
|
||||
|
||||
const handleOpenBrowser = useCallback(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue