Skip to content

Commit 0751e4c

Browse files
committed
refactor: update Toast component to use Button from UI library
- Replaced native button elements with the Button component from the UI library for consistency in styling and behavior. - Updated the dismiss button to utilize the new XIcon for improved visual representation.
1 parent 8f68d60 commit 0751e4c

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

src/entrypoints/content/components/toast.tsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { AlertCircle, CheckCircle, Info, X, XCircle } from "lucide-react";
1+
import { AlertCircle, CheckCircle, Info, XCircle, XIcon } from "lucide-react";
2+
import { Button } from "@/components/ui/button";
23
import type { ToastType } from "@/components/ui/sonner";
34

45
export interface ToastProps {
@@ -41,23 +42,19 @@ export function Toast({
4142
<div className="flex-1 space-y-1">
4243
<p className="text-sm font-medium text-foreground">{message}</p>
4344
{action && (
44-
<button
45-
type="button"
46-
onClick={action.onClick}
47-
className="text-sm font-medium text-primary hover:underline"
48-
>
45+
<Button variant="outline" size="xs" onClick={action.onClick}>
4946
{action.label}
50-
</button>
47+
</Button>
5148
)}
5249
</div>
53-
<button
54-
type="button"
50+
<Button
51+
variant="ghost"
52+
size="icon-sm"
5553
onClick={onDismiss}
56-
className="shrink-0 rounded-md p-1 hover:bg-muted transition-colors"
5754
aria-label="Dismiss"
5855
>
59-
<X className="h-4 w-4 text-muted-foreground" />
60-
</button>
56+
<XIcon className="h-4 w-4 text-muted-foreground" />
57+
</Button>
6158
</div>
6259
</div>
6360
);

0 commit comments

Comments
 (0)