import { useState } from "react"; import { Button, Input, ThemeProvider } from "@ace/ui"; import { IconGlobe } from "@ace/ui/icons"; import { normalize, remember } from "./address"; /** The deployed web app has no host of its own; the person names theirs once. */ export function Connect({ previous }: { previous?: string }) { const [value, setValue] = useState(previous ?? ""); const target = normalize(value); return (
{ event.preventDefault(); if (!target) return; remember(target); location.reload(); }} >

Connect to your host

{previous ? `Couldn't reach ${previous}. Check that Tailscale is on, then try again or enter another host.` : "Enter the address your Ace host prints for HTTPS, such as mac.tailnet.ts.net:5141. This device must be on your tailnet."}

setValue(event.target.value)} />
); }