from datetime import datetime
import click
import json


def write_json_file(file_name: str, results: list) -> str:
    """Write data to json file"""

    now = datetime.now()
    timestamp = f"_{now.month}-{now.day}-{now.year}_{now.hour}-{now.minute}.json"

    file_path = file_name + timestamp

    click.secho(f"[*] Writing results to {file_path}", fg="green")
    with open(file_path, "w") as f:
        json.dump(results, f, indent=4)

    return file_path