import { HTMLProps } from 'react'; import { DroppedFile, useFileDrop } from './useFileDrop.ts'; import { SubstraitVizTheme } from '@substrait-viz/react'; export interface FileCardAddProps extends HTMLProps { label: string; theme: SubstraitVizTheme; onAdd: (file: DroppedFile) => void; } export function FileCardAdd({ className = '', label, theme, onAdd, ...props }: FileCardAddProps) { const { dragState, handleDragOver, handleDragLeave, handleDrop, triggerFileInput, fileInputRef, handleFileSelect, } = useFileDrop(onAdd); return (
{dragState === 'dragging' ? ( 'Drop to add' ) : ( + {label} )}
); }