wip commit

This commit is contained in:
Brent O'Neill 2025-10-06 08:50:19 -06:00
parent d6519c5600
commit a2e1210a4d
5 changed files with 16 additions and 7 deletions

View file

@ -6,7 +6,6 @@ import { useEffect, useState } from "react";
import { type CloudFile, UnifiedCloudPicker } from "@/components/cloud-picker"; import { type CloudFile, UnifiedCloudPicker } from "@/components/cloud-picker";
import type { IngestSettings } from "@/components/cloud-picker/types"; import type { IngestSettings } from "@/components/cloud-picker/types";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { Toast } from "@/components/ui/toast";
import { useTask } from "@/contexts/task-context"; import { useTask } from "@/contexts/task-context";
// CloudFile interface is now imported from the unified cloud picker // CloudFile interface is now imported from the unified cloud picker
@ -345,6 +344,7 @@ export default function UploadProviderPage() {
onFileSelected={handleFileSelected} onFileSelected={handleFileSelected}
selectedFiles={selectedFiles} selectedFiles={selectedFiles}
isAuthenticated={true} isAuthenticated={true}
isIngesting={isIngesting}
accessToken={accessToken || undefined} accessToken={accessToken || undefined}
clientId={connector.clientId} clientId={connector.clientId}
onSettingsChange={setIngestSettings} onSettingsChange={setIngestSettings}
@ -361,14 +361,15 @@ export default function UploadProviderPage() {
Back Back
</Button> </Button>
<Button <Button
variant="secondary" className="bg-foreground text-background hover:bg-foreground/90 font-semibold"
variant={selectedFiles.length === 0 ? "secondary" : undefined}
onClick={() => handleSync(connector)} onClick={() => handleSync(connector)}
disabled={selectedFiles.length === 0 || isIngesting} disabled={selectedFiles.length === 0 || isIngesting}
> >
{isIngesting ? ( {selectedFiles.length === 0 ? (
<>Ingesting {selectedFiles.length} Files...</> <>Ingest files</>
) : ( ) : (
<>Start ingest</> <>Ingesting {selectedFiles.length} files</>
)} )}
</Button> </Button>
</div> </div>

View file

@ -1,7 +1,6 @@
"use client"; "use client";
import { Badge } from "@/components/ui/badge"; import { FileText, Folder, Trash2 } from "lucide-react";
import { FileText, Folder, Trash, Trash2 } from "lucide-react";
import { CloudFile } from "./types"; import { CloudFile } from "./types";
import GoogleDriveIcon from "@/app/settings/icons/google-drive-icon"; import GoogleDriveIcon from "@/app/settings/icons/google-drive-icon";
import SharePointIcon from "@/app/settings/icons/share-point-icon"; import SharePointIcon from "@/app/settings/icons/share-point-icon";
@ -11,6 +10,7 @@ import { Button } from "@/components/ui/button";
interface FileItemProps { interface FileItemProps {
provider: string; provider: string;
file: CloudFile; file: CloudFile;
shouldDisableActions: boolean;
onRemove: (fileId: string) => void; onRemove: (fileId: string) => void;
} }

View file

@ -9,6 +9,7 @@ interface FileListProps {
files: CloudFile[]; files: CloudFile[];
onClearAll: () => void; onClearAll: () => void;
onRemoveFile: (fileId: string) => void; onRemoveFile: (fileId: string) => void;
shouldDisableActions: boolean;
} }
export const FileList = ({ export const FileList = ({
@ -16,11 +17,14 @@ export const FileList = ({
files, files,
onClearAll, onClearAll,
onRemoveFile, onRemoveFile,
shouldDisableActions,
}: FileListProps) => { }: FileListProps) => {
if (files.length === 0) { if (files.length === 0) {
return null; return null;
} }
console.log({ shouldDisableActions });
return ( return (
<div className="space-y-2"> <div className="space-y-2">
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
@ -42,6 +46,7 @@ export const FileList = ({
file={file} file={file}
onRemove={onRemoveFile} onRemove={onRemoveFile}
provider={provider} provider={provider}
shouldDisableActions={shouldDisableActions}
/> />
))} ))}
</div> </div>

View file

@ -25,6 +25,7 @@ export interface UnifiedCloudPickerProps {
baseUrl?: string; baseUrl?: string;
// Ingest settings // Ingest settings
onSettingsChange?: (settings: IngestSettings) => void; onSettingsChange?: (settings: IngestSettings) => void;
isIngesting: boolean;
} }
export interface GoogleAPI { export interface GoogleAPI {

View file

@ -16,6 +16,7 @@ export const UnifiedCloudPicker = ({
onFileSelected, onFileSelected,
selectedFiles = [], selectedFiles = [],
isAuthenticated, isAuthenticated,
isIngesting,
accessToken, accessToken,
onPickerStateChange, onPickerStateChange,
clientId, clientId,
@ -183,6 +184,7 @@ export const UnifiedCloudPicker = ({
files={selectedFiles} files={selectedFiles}
onClearAll={handleClearAll} onClearAll={handleClearAll}
onRemoveFile={handleRemoveFile} onRemoveFile={handleRemoveFile}
shouldDisableActions={isIngesting}
/> />
<IngestSettings <IngestSettings