enzostvs HF Staff commited on
Commit
307913f
·
1 Parent(s): ffe4530
src/components/deploy-button/deploy-button.tsx CHANGED
@@ -10,20 +10,6 @@ import LoadButton from "../load-button/load-button";
10
  import { Button } from "../ui/button";
11
  import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
12
 
13
- const MsgToast = ({ url }: { url: string }) => (
14
- <div className="w-full flex items-center justify-center gap-3">
15
- Your space is live!
16
- <button
17
- className="bg-black text-sm block text-white rounded-md px-3 py-1.5 hover:bg-gray-900 cursor-pointer"
18
- onClick={() => {
19
- window.open(url, "_blank");
20
- }}
21
- >
22
- See Space
23
- </button>
24
- </div>
25
- );
26
-
27
  function DeployButton({
28
  html,
29
  auth,
@@ -60,11 +46,17 @@ function DeployButton({
60
  });
61
  const response = await request.json();
62
  if (response.ok) {
63
- toast.success(
64
- <MsgToast
65
- url={`https://huggingface.co/spaces/${response.path ?? path}`}
66
- />
67
- );
 
 
 
 
 
 
68
  setPath(response.path);
69
  } else {
70
  toast.error(response.message);
 
10
  import { Button } from "../ui/button";
11
  import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  function DeployButton({
14
  html,
15
  auth,
 
46
  });
47
  const response = await request.json();
48
  if (response.ok) {
49
+ toast.success("Your space is live! 🎉", {
50
+ action: {
51
+ label: "See Space",
52
+ onClick: () => {
53
+ window.open(
54
+ `https://huggingface.co/spaces/${response.path ?? path}`,
55
+ "_blank"
56
+ );
57
+ },
58
+ },
59
+ });
60
  setPath(response.path);
61
  } else {
62
  toast.error(response.message);