|
1
|
import { |
|
2
|
CheckCircle, |
|
3
|
ExclamationCircle, |
|
4
|
InformationCircle, |
|
5
|
Spinner, |
|
6
|
XCircle, |
|
7
|
} from "@medusajs/icons" |
|
8
|
import { Button, toast } from "@medusajs/ui" |
|
9
|
|
|
10
|
export default function ToasterAllVariants() { |
|
11
|
return ( |
|
12
|
<div className="flex flex-wrap gap-2"> |
|
13
|
<Button |
|
14
|
variant="secondary" |
|
15
|
onClick={() => |
|
16
|
toast.info("Info", { |
|
17
|
description: "This is an info toast.", |
|
18
|
}) |
|
19
|
} |
|
20
|
> |
|
21
|
<InformationCircle /> Info |
|
22
|
</Button> |
|
23
|
<Button |
|
24
|
variant="secondary" |
|
25
|
onClick={() => |
|
26
|
toast.success("Success", { |
|
27
|
description: "This is a success toast.", |
|
28
|
}) |
|
29
|
} |
|
30
|
> |
|
31
|
<CheckCircle /> Success |
|
32
|
</Button> |
|
33
|
<Button |
|
34
|
variant="secondary" |
|
35
|
onClick={() => |
|
36
|
toast.error("Error", { |
|
37
|
description: "This is an error toast.", |
|
38
|
}) |
|
39
|
} |
|
40
|
> |
|
41
|
<XCircle /> Error |
|
42
|
</Button> |
|
43
|
<Button |
|
44
|
variant="secondary" |
|
45
|
onClick={() => |
|
46
|
toast.warning("Warning", { |
|
47
|
description: "This is a warning toast.", |
|
48
|
}) |
|
49
|
} |
|
50
|
> |
|
51
|
<ExclamationCircle /> Warning |
|
52
|
</Button> |
|
53
|
<Button |
|
54
|
variant="secondary" |
|
55
|
onClick={() => |
|
56
|
toast.loading("Loading", { |
|
57
|
description: "This is a loading toast.", |
|
58
|
}) |
|
59
|
} |
|
60
|
> |
|
61
|
<Spinner /> Loading |
|
62
|
</Button> |
|
63
|
</div> |
|
64
|
) |
|
65
|
} |