function findComponentName(clazz) {
  if (clazz.isClassDeclaration()) {
    // class declaration always has a name
    // @ts-ignore
    return clazz.node.id.name;
  }

  if (clazz.isClassExpression()) {
    if (clazz.node.id && clazz.node.id.name) {
      // class expression can have a name
      return clazz.node.id.name;
    }
  }

  const parent = clazz.parentPath;
  if (parent.isVariableDeclarator()) {
    const id = parent.get('id');
    if (singlePath(id) && id.isIdentifier()) {
      // there is an ID that defines the name of the class
      return id.node.name;
    }
  }
}
@param {NodePath<ClassDeclaration> | NodePath<Expression> } clazz