private static String getComponentType(Component component) {
      return component.getOptions().stream()
        .filter(option -> "type".equals(option.getName().getValue()))
        .map(Option::getValue)
        .map(GenericValue::getValue)
        .filter(Objects::nonNull)
        .findFirst()
        .orElse(null);
    }
private static String getComponentType(Component component)