(value: string | null)
| 42 | type CreatedKey = ApiKeySummary & { readonly value: string }; |
| 43 | |
| 44 | const formatDate = (value: string | null): string => { |
| 45 | if (!value) return "Never"; |
| 46 | const date = new Date(value); |
| 47 | return Number.isNaN(date.getTime()) |
| 48 | ? value |
| 49 | : new Intl.DateTimeFormat(undefined, { |
| 50 | month: "short", |
| 51 | day: "numeric", |
| 52 | year: "numeric", |
| 53 | }).format(date); |
| 54 | }; |
| 55 | |
| 56 | const defaultApiKeyName = (): string => |
| 57 | `API key ${new Intl.DateTimeFormat(undefined, { |