Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/SantaClaas/gigit. git client
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637import { chooseRepositoryFolder } from "../lib/picker";
/** * Opening a repository by choosing a folder. * * Any folder inside a repository will do — the Rust side searches upwards the * way git does, so picking a subdirectory works. */export default function OpenRepository(props: { busy: boolean; onOpen: (path: string) => void; /** Styling differs between the title bar and the welcome pane. */ class?: string; children?: string;}) { async function choose() { const path = await chooseRepositoryFolder();
// Dismissing the dialog is an ordinary outcome, not something to report. if (path) props.onOpen(path); }
return ( <button type="button" disabled={props.busy} onClick={choose} class={[ "rounded-large bg-primary px-4 py-2 text-label-lg text-on-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:opacity-50", props.class, ]} > {props.busy ? "Opening…" : (props.children ?? "Open repository…")} </button> );}