(iso: string | null | undefined)
| 35 | type IntegrationConnection = components['schemas']['IntegrationConnectionResponse']; |
| 36 | |
| 37 | function formatTimestamp(iso: string | null | undefined): string { |
| 38 | if (!iso) { |
| 39 | return '—'; |
| 40 | } |
| 41 | |
| 42 | try { |
| 43 | return new Intl.DateTimeFormat('en-US', { |
| 44 | month: 'short', |
| 45 | day: 'numeric', |
| 46 | year: 'numeric', |
| 47 | hour: '2-digit', |
| 48 | minute: '2-digit', |
| 49 | }).format(new Date(iso)); |
| 50 | } catch (error) { |
| 51 | console.error('Failed to format timestamp', error); |
| 52 | return iso; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | function getProviderConnection( |
| 57 | providerId: string, |
no test coverage detected