import 'dart:ui';

import 'package:syncrow_web/pages/spaces_management/all_spaces/model/connection_model.dart';
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/space_model.dart';

class ConnectionHelper {
  static Offset getCenterPosition(Size screenSize) {
    return Offset(
      screenSize.width / 2 - 260,
      screenSize.height / 2 - 200,
    );
  }

  static bool isHighlightedConnection(
      Connection connection, SpaceModel? selectedSpace) {
    if (selectedSpace == null) return true;

    return connection.startSpace == selectedSpace ||
        connection.endSpace == selectedSpace;
  }
}
