mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-15 18:25:18 +02:00
refactor: streamline connector status handling and remove warnings
- Removed the warning message handling from `useConnectorStatus` and related components to simplify status management. - Updated `ConnectorCard` and `ConnectorAccountsListView` to eliminate warning displays, focusing on status messages instead. - Adjusted the connector status configuration to remove warning properties, enhancing clarity and reducing complexity.
This commit is contained in:
parent
207595bb33
commit
b0043b6446
4 changed files with 18 additions and 51 deletions
|
|
@ -110,14 +110,12 @@ export const ConnectorCard: FC<ConnectorCardProps> = ({
|
|||
const {
|
||||
getConnectorStatus,
|
||||
isConnectorEnabled,
|
||||
getConnectorWarning,
|
||||
getConnectorStatusMessage,
|
||||
shouldShowWarnings,
|
||||
} = useConnectorStatus();
|
||||
|
||||
const status = getConnectorStatus(connectorType);
|
||||
const isEnabled = isConnectorEnabled(connectorType);
|
||||
const warning = getConnectorWarning(connectorType);
|
||||
const statusMessage = getConnectorStatusMessage(connectorType);
|
||||
const showWarnings = shouldShowWarnings();
|
||||
|
||||
|
|
@ -159,11 +157,6 @@ export const ConnectorCard: FC<ConnectorCardProps> = ({
|
|||
return <span className="whitespace-nowrap text-[10px]">Never indexed</span>;
|
||||
}
|
||||
|
||||
// Show warning message if available and warnings are enabled (only if no status message)
|
||||
if (warning && showWarnings) {
|
||||
return <span className="text-[10px] text-yellow-600 dark:text-yellow-500">{warning}</span>;
|
||||
}
|
||||
|
||||
return description;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue