import { getStudioStage } from "@/lib/studio-canvas-stage";

export function downloadCanvasSnapshot(): boolean {
  const stage = getStudioStage();
  if (!stage) return false;

  const dataUrl = stage.toDataURL({ pixelRatio: 2 });
  const link = document.createElement("a");
  link.download = `snapshot-${Date.now()}.png`;
  link.href = dataUrl;
  link.click();
  return true;
}
