import React, { useRef } from "react"; import { UploadIcon, ChevronRight, Plus, FileText, X } from "lucide-react"; import { ProcessedSlide } from "../types"; interface FileUploadSectionProps { selectedFile: File | null; handleFileSelect: (event: React.ChangeEvent) => void; removeFile: () => void; CheckFonts: () => void; onPptxFileSelect?: (file: File) => void | Promise; processingLabel?: string; isProcessingPptx: boolean; slides: ProcessedSlide[]; completedSlides: number; } export const FileUploadSection: React.FC = ({ selectedFile, handleFileSelect, removeFile, CheckFonts, onPptxFileSelect, processingLabel = "Checking Fonts...", isProcessingPptx, slides, completedSlides, }) => { const isProcessing = isProcessingPptx || slides.some((s) => s.processing); const fileInputRef = useRef(null); const handleCheckFonts = () => { if (!selectedFile && onPptxFileSelect) { fileInputRef.current?.click(); return; } CheckFonts(); } const handleInputChange = (event: React.ChangeEvent) => { const file = event.target.files?.[0]; if (onPptxFileSelect) { event.target.value = ""; if (file) { void onPptxFileSelect(file); } return; } handleFileSelect(event); }; return (

Upload PPTX File

{!selectedFile ? <>

Click to Upload or drag & drop.

:

{selectedFile.name}

Presentation ( {(selectedFile.size / (1024 * 1024)).toFixed(2)} MB)

}
{isProcessing ? (
) : (
)}
  • PPTX. Only

  • Max 100MB

  • 5min Generation

); };