import click


def prompt_config(record_type):
    """Prompt user for record config."""
    if record_type == "REDIRECT":
        redirect_url = click.prompt("Enter domain to redirect to", type=str)
        protocol = click.prompt(
            "Enter protocol for redirects",
            type=click.Choice(["http", "https"]),
        )
        config = {"value": redirect_url, "protocol": protocol}
    else:
        lines = []
        value = click.prompt(
            f"Enter {record_type} value (Press enter for multi-line values)",
            type=str,
        )
        lines.append(value)
        while value:
            value = click.prompt(
                "Enter another line value (Leave blank to confirm)", default=""
            )
            if value:
                lines.append(value)

        if len(lines) == 1:
            config = {"value": lines[0]}
        else:
            config = {"value": "\n".join(lines)}

    return config