@Nullable
  private static JComponent createTitleWithNotifications(@Nullable DiffViewer viewer,
                                                         @Nullable JComponent title,
                                                         @Nullable DiffContent content) {
    List<JComponent> components = new ArrayList<>();
    if (title != null) components.add(title);

    if (content != null) {
      components.addAll(createCustomNotifications(viewer, content));
    }

    if (content instanceof DocumentContent documentContent) {
      Document document = documentContent.getDocument();
      if (FileDocumentManager.getInstance().isPartialPreviewOfALargeFile(document)) {
        components.add(wrapEditorNotificationComponent(
          DiffNotifications.createNotification(DiffBundle.message("error.file.is.too.large.only.preview.is.loaded"))));
      }
    }

    if (content instanceof FileContent fileContent) {
      VirtualFile file = fileContent.getFile();
      if (file.isInLocalFileSystem() && !file.isValid()) {
        components.add(wrapEditorNotificationComponent(
          DiffNotifications.createNotification(DiffBundle.message("error.file.is.not.valid"))));
      }
    }

    if (components.isEmpty()) return null;
    return createStackedComponents(components, TITLE_GAP);
  }
@Nullable
  private static JComponent createTitleWithNotifications(@Nullable DiffViewer viewer,
                                                         @Nullable JComponent title,
                                                         @Nullable DiffContent content)