import { open } from '@tauri-apps/plugin-dialog'; import { Button } from './core/Button'; import { HStack } from './core/Stacks'; interface Props { onChange: (filePath: string | null) => void; filePath: string | null; } export function SelectFile({ onChange, filePath }: Props) { const handleClick = async () => { const selected = await open({ title: 'Select File', multiple: false, }); if (selected == null) onChange(null); else onChange(selected.path); }; return (
{/* Special character to insert ltr text in rtl element without making things wonky */} ‎ {filePath ?? 'No file selected'}
); }