import { Box, Text, useUiHost } from "../../../ui"; import { colors } from "../../../theme/colors"; import { t, tf } from "../../../i18n"; import type { ListViewItem } from "../../ui"; import { getBrokerLabel } from "./utils"; export function BrokerSyncPanel({ choices, selectedBrokerId, brokerSyncing, brokerSyncError, }: { choices: ListViewItem[]; selectedBrokerId: string; brokerSyncing: boolean; brokerSyncError: string | null; }) { const brokerLabel = getBrokerLabel(choices, selectedBrokerId); const desktop = useUiHost().kind === "desktop-web"; return ( {brokerSyncing ? tf("Connecting to {broker} and importing accounts and positions...", { broker: brokerLabel }) : brokerSyncError || tf("Unable to sync {broker}.", { broker: brokerLabel })} {brokerSyncing ? t("This happens now so your portfolio is ready before onboarding finishes.") : t("Press Enter to retry, or Backspace to edit the broker settings.")} ); }