{JSON.stringify(session.profile, null, 2)}
}
/>
} />
} />
);
}
function providerLabel(provider: IdentityProvider) {
switch (provider) {
case 1:
return 'manual';
case 2:
return 'google';
default:
return 'unknown';
}
}
function paymentStatusColor(status: string) {
switch (status.toLowerCase()) {
case 'captured':
case 'paid':
return 'green';
case 'payable':
case 'ready':
return 'blue';
case 'pending':
case 'authorized':
return 'orange';
case 'failed':
case 'blocked':
return 'red';
default:
return 'default';
}
}
function paymentProgressHint(status: string) {
switch (status.toLowerCase()) {
case 'payable':
case 'ready':
return 'ready for payment capture after service completion';
case 'pending':
case 'authorized':
return 'payment is in progress and should be monitored before retrying';
case 'captured':
case 'paid':
return 'payment is complete and the restaurant workflow can close';
case 'failed':
case 'blocked':
return 'operator review is required before attempting another capture';
default:
return 'payment state is being resolved against the restaurant lifecycle';
}
}
function formatUtc(value: string) {
return new Date(value).toLocaleString('en-US', {
dateStyle: 'medium',
timeStyle: 'short',
timeZone: 'UTC'
});
}
export default App;