// Copyright (C) 2025 AIDC-AI
// Licensed under the MIT License.

export function downloadJsonFile(jsonStr: string, fileName: string) {
  const blob = new Blob([jsonStr], { type: "application/json" });
  const url = URL.createObjectURL(blob);

  const a = document.createElement("a");
  a.href = url;
  a.download = `${fileName}.json`;
  document.body.appendChild(a);
  a.click();
  document.body.removeChild(a);
  URL.revokeObjectURL(url);
}
