from pathlib import Path
import base64


def get_image(filename: str) -> str:
    """Helper function to add images to the HTML.

    Args:
        filename (str):
            The name of the image file to add.

    Returns:
        str:
            The bytestring of the b64 encoded image.
    """
    assets_path = Path(__file__).parent.parent / "assets"
    img_path = assets_path / filename
    b64_encoded = base64.b64encode(img_path.read_bytes())
    return b64_encoded.decode()