ui refactor
This commit is contained in:
18
app/lib/api/connection.ts
Normal file
18
app/lib/api/connection.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export interface ConnectionStatus {
|
||||
connected: boolean;
|
||||
latency: number;
|
||||
lastChecked: string;
|
||||
}
|
||||
|
||||
export const checkConnection = async (): Promise<ConnectionStatus> => {
|
||||
/*
|
||||
* TODO: Implement actual connection check logic
|
||||
* This is a mock implementation
|
||||
*/
|
||||
const connected = Math.random() > 0.1; // 90% chance of being connected
|
||||
return {
|
||||
connected,
|
||||
latency: connected ? Math.floor(Math.random() * 1500) : 0, // Random latency between 0-1500ms
|
||||
lastChecked: new Date().toISOString(),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user