()
| 98 | const missingOAuthScopes = connection.missingOAuthScopes ?? []; |
| 99 | |
| 100 | const handleCheck = async () => { |
| 101 | if (checking) return; |
| 102 | setChecking(true); |
| 103 | const exit = await runCheck(); |
| 104 | setChecking(false); |
| 105 | if (Exit.isFailure(exit)) { |
| 106 | toast.error(messageFromExit(exit, "Health check failed")); |
| 107 | return; |
| 108 | } |
| 109 | // The hook already folded the fresh probe into the live state. |
| 110 | if (exit.value.status === "healthy") { |
| 111 | toast.success( |
| 112 | exit.value.identity ? `Healthy: ${exit.value.identity}` : "Connection is healthy", |
| 113 | ); |
| 114 | } else if (exit.value.status === "expired") { |
| 115 | toast.error("Connection expired, reconnect to restore access"); |
| 116 | } else if (exit.value.status === "degraded") { |
| 117 | toast.warning(exit.value.detail ?? "Connection check returned an error"); |
| 118 | } else { |
| 119 | toast.message("No health check is configured for this integration"); |
| 120 | } |
| 121 | }; |
| 122 | |
| 123 | return ( |
| 124 | <CardStackEntry className="flex-wrap items-start"> |
no test coverage detected