import { createSignal } from "solid-js"; /** * Opening a repository by path. * * A plain form, because a native folder picker needs the Tauri dialog plugin * and that is a dependency this change does not need. The picker arrives with * the repository-picker work, along with recent repositories; until then a path * still gets you in, and anything below a repository's root works because the * Rust side searches upwards the way git does. */ export default function OpenRepository(props: { busy: boolean; onOpen: (path: string) => void }) { const [path, setPath] = createSignal(""); function onSubmit(event: SubmitEvent) { event.preventDefault(); const trimmed = path().trim(); if (trimmed) props.onOpen(trimmed); } return (
setPath(event.currentTarget.value)} class="w-72 rounded-small border border-outline bg-surface px-3 py-1.5 text-body-md text-on-surface focus-visible:outline-2 focus-visible:outline-offset-[-1px] focus-visible:outline-primary" />
); }