from typing import Tuple


def optional_type(s: str) -> Tuple[str, bool]:
    """Determine if a type is optional and parse the actual type name."""
    if s.endswith("(optional)"):
        return s[: s.find("(optional)")].strip(), True
    return s, False