Add web interface and tests

This commit is contained in:
aet
2021-11-05 03:17:18 -04:00
parent 7f41a50fb1
commit 30e5a1f484
67 changed files with 3574 additions and 1275 deletions

View File

@ -0,0 +1,19 @@
import { useCallback } from "react"
export const VaultPicker: React.FC<{
setHandle(handle: FileSystemDirectoryHandle): void
}> = ({ setHandle }) => {
const onClick = useCallback(async () => {
try {
const handle = await showDirectoryPicker()
setHandle(handle)
} catch (e) {
if ((e as Error).name === "AbortError") {
return
}
alert(e)
}
}, [setHandle])
return <button onClick={onClick}>Pick a vault here.</button>
}