import ast
from typing import Optional
from typing import List


def _parse_class_comment(class_def: ast.ClassDef) -> Optional[List[str]]:
    """
    Parses docstring comment of a class from AST.
    """
    class_comment = None

    if class_def.body:
        mem = class_def.body[0]
        if isinstance(mem, ast.Expr) and isinstance(mem.value, ast.Constant):
            class_comment = []
            for line in mem.value.value.strip().split("\n"):
                class_comment.append(line)

    return class_comment