()
| 120 | const missingOAuthScopes = connection.missingOAuthScopes ?? []; |
| 121 | |
| 122 | const handleCheck = async () => { |
| 123 | if (checking) return; |
| 124 | setChecking(true); |
| 125 | const exit = await runCheck(); |
| 126 | setChecking(false); |
| 127 | if (Exit.isFailure(exit)) { |
| 128 | toast.error(messageFromExit(exit, "Health check failed")); |
| 129 | return; |
| 130 | } |
| 131 | // The hook already folded the fresh probe into the live state. |
| 132 | if (exit.value.status === "healthy") { |
| 133 | toast.success( |
| 134 | exit.value.identity ? `Healthy: ${exit.value.identity}` : "Connection is healthy", |
| 135 | ); |
| 136 | } else if (exit.value.status === "expired") { |
| 137 | toast.error("Connection expired, reconnect to restore access"); |
| 138 | } else if (exit.value.status === "degraded") { |
| 139 | toast.warning(exit.value.detail ?? "Connection check returned an error"); |
| 140 | } else { |
| 141 | toast.message("No health check is configured for this integration"); |
| 142 | } |
| 143 | }; |
| 144 | |
| 145 | return ( |
| 146 | <CardStackEntry className="flex-wrap items-start"> |
no test coverage detected