@orsetra/shared-ui 1.11.3 → 1.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -36,10 +36,11 @@ export interface AlertBannerProps
|
|
|
36
36
|
onClose?: () => void
|
|
37
37
|
closable?: boolean
|
|
38
38
|
icon?: React.ReactNode
|
|
39
|
+
action?: React.ReactNode
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
const AlertBanner = React.forwardRef<HTMLDivElement, AlertBannerProps>(
|
|
42
|
-
({ className, variant = "info", message, onClose, closable = true, icon, ...props }, ref) => {
|
|
43
|
+
({ className, variant = "info", message, onClose, closable = true, icon, action, ...props }, ref) => {
|
|
43
44
|
const Icon = iconMap[variant || "info"]
|
|
44
45
|
|
|
45
46
|
return (
|
|
@@ -51,6 +52,7 @@ const AlertBanner = React.forwardRef<HTMLDivElement, AlertBannerProps>(
|
|
|
51
52
|
>
|
|
52
53
|
{icon || <Icon className="h-5 w-5 flex-shrink-0" />}
|
|
53
54
|
<span className="flex-1">{message}</span>
|
|
55
|
+
{action && <div className="flex-shrink-0 flex items-center">{action}</div>}
|
|
54
56
|
{closable && onClose && (
|
|
55
57
|
<button
|
|
56
58
|
onClick={onClose}
|