({ onImportOptionClick })
| 26 | } |
| 27 | |
| 28 | const EmptyDataState: React.FC<Props> = ({ onImportOptionClick }) => { |
| 29 | const { fileInputRef, handleButtonClick, handleFileSelect, isProcessing } = useFileUpload(); |
| 30 | const [showDemoWizard, setShowDemoWizard] = useState(false); |
| 31 | |
| 32 | const { t } = useTranslation(); |
| 33 | const { showAIAssistant } = useAppStore(); |
| 34 | const { linkFolder } = useFolderStore(); |
| 35 | |
| 36 | const getUploadText = () => { |
| 37 | if (isProcessing) return t('preview.empty.processing', 'Processing files...'); |
| 38 | return t('preview.empty.dropOrClick', 'Drop files here or click to browse'); |
| 39 | }; |
| 40 | |
| 41 | const handleOpenFolder = async () => { |
| 42 | if (!('showDirectoryPicker' in window)) { |
| 43 | alert(t('workspace.toolbar.browserNotSupported', 'Your browser does not support folder access. Please use Chrome or Edge.')); |
| 44 | return; |
| 45 | } |
| 46 | |
| 47 | try { |
| 48 | const directoryHandle = await (window as any).showDirectoryPicker({ |
| 49 | mode: 'read', |
| 50 | }); |
| 51 | |
| 52 | // Import the folder structure |
| 53 | await linkFolder(directoryHandle, null); |
| 54 | } catch (error) { |
| 55 | if ((error as Error).name !== 'AbortError') { |
| 56 | console.error('Error opening folder:', error); |
| 57 | } |
| 58 | } |
| 59 | }; |
| 60 | |
| 61 | const remoteOptions: RemoteImportOption[] = [ |
| 62 | { |
| 63 | id: "postgresql", |
| 64 | name: t('preview.providers.postgresql.name'), |
| 65 | icon: <img src={postgresIcon} className="h-5 w-5" />, |
| 66 | description: t('preview.providers.postgresql.description'), |
| 67 | }, |
| 68 | { |
| 69 | id: "s3", |
| 70 | name: t('preview.providers.s3.name'), |
| 71 | icon: <img src={S3} className="h-4 w-4" />, |
| 72 | description: t('preview.providers.s3.description'), |
| 73 | }, |
| 74 | { |
| 75 | id: "huggingface", |
| 76 | name: t('preview.providers.huggingface.name'), |
| 77 | icon: <img src={HuggingFace} className="h-5 w-5" />, |
| 78 | description: t('preview.providers.huggingface.description'), |
| 79 | }, |
| 80 | { |
| 81 | id: "google-sheets", |
| 82 | name: t('preview.providers.googleSheets.name'), |
| 83 | icon: <GoogleSheetsIcon className="h-5 w-5" />, |
| 84 | description: t('preview.providers.googleSheets.description'), |
| 85 | } |
nothing calls this directly
no test coverage detected