import {useEffect,useState} from 'react'; import {api} from './api'; import {hotelTime} from './time'; type Health={ checkedAt:string;timeZone:string;preview:boolean;database:string; worker:{state:string;lastSeenAt:string|null}; mailboxes:{total:number;connected:number;attention:number}; replies:{sampleSize:number;sampleLimit:number;pending:number;uncertain:number;rejected:number}; }; export function OperationsPage({owner,go}:{owner:boolean;go:(path:string)=>void}){ const [data,setData]=useState(null),[error,setError]=useState(''),[busy,setBusy]=useState(false); async function refresh(){setBusy(true);setError('');try{setData(await api('/operations'));}catch(e){setError(e instanceof Error?e.message:'Unable to check workspace health.');}finally{setBusy(false);}} useEffect(()=>{if(owner)void refresh();},[owner]); if(!owner)return

Workspace health

Your hotel owner can review operational health.

; const when=(value:string|null)=>value?hotelTime(value,data?.timeZone||'UTC'):'Not yet'; return
Keep your workspace running

Workspace health

Spot connection and delivery issues before they affect your team.

{error&&
{error} The information below may be out of date.
} {data&&<>

Checked {when(data.checkedAt)}{data.preview?' · Sample workspace':''}

Application and worker

Database connection{data.preview?'Temporary preview storage':data.database}
Background worker{data.worker.state==='Reporting'?'Reporting normally':data.worker.state==='Preview'?'Unavailable in preview':data.worker.state==='Stale'?'Heartbeat overdue':'No heartbeat received'}
Last worker heartbeat{when(data.worker.lastSeenAt)}
{['Stale','NotSeen'].includes(data.worker.state)&&

Ask your server administrator to check the worker container and its database connection. Imports and queued replies may be delayed.

}

A heartbeat confirms the worker process can reach storage. It does not prove that Google, payment or PMS requests are succeeding.

Mailbox connections

Total{data.mailboxes.total}
Connected{data.mailboxes.connected}
Need attention{data.mailboxes.attention}

Reply delivery

Queued or submitting{data.replies.pending}
Need verification{data.replies.uncertain}
Stopped before sending{data.replies.rejected}

Based on {data.replies.sampleSize} recent conversations, up to {data.replies.sampleLimit}. Older deliveries may exist. Verify uncertain results in Gmail before taking further action.

Backups and recovery

Your server administrator runs encrypted backups and isolated restore drills. Ask them to confirm the latest off-server backup and successful restore test.

This page does not claim a backup exists or that the server is ready for production. Provider acceptance and recovery checks are separate.

}
; }