{/*
The status is the main operational signal for a remote instance, so it
stays beside the human-facing description where users naturally scan
the server summary. Latency is intentionally moved to the title bar as
quiet metadata because it is useful detail, not the primary decision.
*/}
{online && instance.description ?
{instance.description}
: null}
{online && features.length ? (
{features.map((feature) => (
{feature}
))}
) : null}
{online ? children : null}
);
}
function RemoteMediaStrip({ remote }) {
const roomCameras = Array.isArray(remote.roomCameras) ? remote.roomCameras.filter((camera) => camera.snapshotUrl) : [];
if (!roomCameras.length) return null;
return (
{roomCameras.map((camera) => (
))}
);
}
export function ExternalInstancesCompact({ onBrowse = null }) {
const enabled = useInterInstanceEnabled();
const instances = useRemoteInstances();
const visible = useMemo(() => instances.filter((remote) => remote?.online || remote?.url), [instances]);
if (!enabled) return null;
if (!visible.length) return null;
const browseAction = onBrowse ? (
) : null;
return (
/*
External instances are intentionally always mounted. Besides removing an
unnecessary disclosure click, this preserves the live queue rows while
the local Rover Queues card can provide one continuous scroll surface for
both its local and external rows. Scrolling belongs to that owning panel,
so this nested section deliberately keeps its natural content height.
*/
{/*
One containing card gives the remote-server collection a clear boundary
below the local rover rows. Individual remote queue cards stay intact
inside it because they still own each server's title and operational
status, while this outer title bar owns the collection-wide browser.
*/}
{visible.map((remote) =>
remote.online ? (
) : (
),
)}
);
}
export function InterInstancePopup({ onClose }) {
return (
{/*
The large browser should read as one card per external server:
the server metadata, room snapshots, and the exact existing rover
queues panel are grouped together here. RoverQueuesPanel keeps its
own CardFrame and default title, so this component only controls
where that already-existing panel is placed.
*/}
<>
>
))}
);
}
export function InterInstanceBrowserFrame({
onClose = null,
hideWhenEmpty = false,
className = '',
bodyClassName = 'p-0.5',
centered = false,
scaledOverlay = false,
singleColumn = false,
}) {
const enabled = useInterInstanceEnabled();
const instances = useRemoteInstances();
if (!enabled) return null;
if (!instances.length && hideWhenEmpty) return null;
const actions = onClose ? (
) : null;
/*
This frame is shared by the popup and the admin/lockdown overlay. Keeping
the wrapper here means those surfaces get the same external-instance card
without placing it inside the login card or duplicating layout behavior.
*/
return (
{instances.length ? (
) : (
No external instances discovered.
)}
);
}
export default function InterInstancePanel({ compact = false, centered = false }) {
const enabled = useInterInstanceEnabled();
const instances = useRemoteInstances();
if (!enabled) return null;
if (compact) return ;
if (!instances.length) {
return (