import { useId, type ReactNode } from "react"; import { RotateCw } from "lucide-react"; import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover"; import { Button } from "../ui/button"; import { ADDRESS_SUFFIX, addressStatus, type AddressCheck } from "../../utils/practiceAddress"; import "./PracticeAddress.css"; type PracticeAddressFieldProps = { value: string; onChange: (value: string) => void; check: AddressCheck | undefined; suggested: boolean; onRetry: () => void; disabled?: boolean; // What the deck draws between the About control and the address (the practice name). children?: ReactNode; }; // admin-v2 "Choose your practice web address". The About panel is a labelled control rather than a // hover; the permanent-address note stays outside it so nobody has to open it to be warned. const PracticeAddressField = ({ value, onChange, check, suggested, onRetry, disabled, children }: PracticeAddressFieldProps) => { const id = useId().replace(/:/g, ""); const status = addressStatus(value, check, suggested); const problem = status?.tone === "problem"; return (

Your included Akashic portal. Use it if you want to.

{/* A native button: the trigger needs a ref to anchor the panel, which Button does not forward. */}
Your choice of client
Every practice gets a standalone Akashic portal at this address.
Prefer your own website? You can use only the WordPress plugin on your own domain. You do not have to use this portal, and it does not replace your website.
You can also use both clients for the same practice.
Choose your practice's portal address now, even if you do not plan to use it. It cannot be changed once saved.
{children}
onChange(event.target.value)} aria-invalid={problem} aria-describedby={`practice-address-${id}-status`} autoComplete="off" spellCheck={false} disabled={disabled} /> {ADDRESS_SUFFIX}
{status?.text} {status?.retry && ( )}

Use letters a–z only. Choose the name you want patients and staff to use.

{/* One wrapper, so the bold lead stays in the same text run: .ak-notice is a flex row. */} This address is permanent. You can change the suggestion now. Once saved, the address cannot be changed.
); }; export default PracticeAddressField;