import type { Component } from 'solid-js'; import { UploadCloud } from 'lucide-solid'; interface FileUploadProps { onFileSelect: (text: string) => void; } const FileUpload: Component = (props) => { const handleFileChange = (e: Event) => { const input = e.target as HTMLInputElement; const file = input.files?.[0]; if (!file) return; const reader = new FileReader(); reader.onload = (event) => { const text = event.target?.result as string; props.onFileSelect(text); }; reader.readAsText(file); }; return (
); }; export default FileUpload;