"""Shared utilities for component functions."""
from __future__ import annotations
from typing import Any

def _check_visible(visible: Any) -> bool:
    """Evaluate a visibility condition. Returns True if the component should render."""
    if callable(visible):
        try:
            return bool(visible())
        except Exception:
            return False
    return bool(visible)
