enzostvs HF Staff commited on
Commit
ccdf544
·
1 Parent(s): 8aa119d

hide buttons if ai is working

Browse files
Files changed (1) hide show
  1. src/components/preview/preview.tsx +25 -23
src/components/preview/preview.tsx CHANGED
@@ -50,29 +50,31 @@ function Preview({
50
  })}
51
  srcDoc={html}
52
  />
53
- <div className="flex items-center justify-start gap-3 absolute bottom-3 lg:bottom-5 max-lg:left-3 lg:right-5">
54
- <button
55
- className="lg:hidden bg-gray-950 shadow-md text-white text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-900 hover:brightness-150 transition-all duration-100 cursor-pointer"
56
- onClick={() => setView("editor")}
57
- >
58
- <FaLaptopCode />
59
- Back to Editor
60
- </button>
61
- <a
62
- href="https://huggingface.co/spaces/victor/deepsite-gallery"
63
- target="_blank"
64
- className="bg-gray-200 text-gray-950 text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-200 hover:bg-gray-300 transition-all duration-100 cursor-pointer"
65
- >
66
- 🖼️ <span>Deepsite Gallery</span>
67
- </a>
68
- <button
69
- className="bg-white lg:bg-gray-950 shadow-md text-gray-950 lg:text-white text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-100 lg:border-gray-900 hover:brightness-150 transition-all duration-100 cursor-pointer"
70
- onClick={handleRefreshIframe}
71
- >
72
- <TbReload />
73
- Refresh Preview
74
- </button>
75
- </div>
 
 
76
  </div>
77
  );
78
  }
 
50
  })}
51
  srcDoc={html}
52
  />
53
+ {!isAiWorking && (
54
+ <div className="flex items-center justify-start gap-3 absolute bottom-3 lg:bottom-5 max-lg:left-3 lg:right-5">
55
+ <button
56
+ className="lg:hidden bg-gray-950 shadow-md text-white text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-900 hover:brightness-150 transition-all duration-100 cursor-pointer"
57
+ onClick={() => setView("editor")}
58
+ >
59
+ <FaLaptopCode />
60
+ Back to Editor
61
+ </button>
62
+ <a
63
+ href="https://huggingface.co/spaces/victor/deepsite-gallery"
64
+ target="_blank"
65
+ className="bg-gray-200 text-gray-950 text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-200 hover:bg-gray-300 transition-all duration-100 cursor-pointer"
66
+ >
67
+ 🖼️ <span>Deepsite Gallery</span>
68
+ </a>
69
+ <button
70
+ className="bg-white lg:bg-gray-950 shadow-md text-gray-950 lg:text-white text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-100 lg:border-gray-900 hover:brightness-150 transition-all duration-100 cursor-pointer"
71
+ onClick={handleRefreshIframe}
72
+ >
73
+ <TbReload />
74
+ Refresh Preview
75
+ </button>
76
+ </div>
77
+ )}
78
  </div>
79
  );
80
  }