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

View file

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

View file

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

View file

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

View file

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