@@ -2,41 +2,40 @@ import { Button } from "@/components/Actions/Button"
2
2
import Share from "@/icons/app/Share"
3
3
import { AlertAvatar } from "../Information/Avatars/AlertAvatar"
4
4
5
- type BannerProps = {
5
+ type AlertProps = {
6
6
title : string
7
7
description : string
8
8
buttonPrimaryLabel : string
9
9
buttonSecondaryLabel : string
10
10
onRequestClick ?: ( ) => void
11
11
onSeeClick ?: ( ) => void
12
- variant : "neutral" | " info" | "warning" | "critical"
12
+ variant : "info" | "warning" | "critical"
13
13
}
14
14
15
- interface BannerType {
15
+ interface AlertType {
16
16
buttonType : "outline" | "promote" | "critical"
17
17
fontColor :
18
18
| "text-f1-foreground"
19
19
| "text-f1-foreground-info"
20
20
| "text-f1-foreground-warning"
21
21
| "text-f1-foreground-critical"
22
22
backgroundColor :
23
- | "bg-f1-background-secondary"
24
23
| "bg-f1-background-info"
25
24
| "bg-f1-background-warning"
26
25
| "bg-f1-background-critical"
27
- alertType : "info" | "warning" | "positive" | " critical"
26
+ alertType : "info" | "warning" | "critical"
28
27
}
29
28
30
- export const Banner = ( {
29
+ export const Alert = ( {
31
30
title,
32
31
description,
33
32
buttonPrimaryLabel,
34
33
buttonSecondaryLabel,
35
34
onRequestClick,
36
35
onSeeClick,
37
36
variant,
38
- } : BannerProps ) => {
39
- const bannerType = ( ) : BannerType => {
37
+ } : AlertProps ) => {
38
+ const alertType = ( ) : AlertType => {
40
39
switch ( variant ) {
41
40
case "info" :
42
41
return {
@@ -59,27 +58,20 @@ export const Banner = ({
59
58
backgroundColor : "bg-f1-background-critical" ,
60
59
alertType : "critical" ,
61
60
}
62
- default :
63
- return {
64
- buttonType : "outline" ,
65
- fontColor : "text-f1-foreground" ,
66
- backgroundColor : "bg-f1-background-secondary" ,
67
- alertType : "positive" ,
68
- }
69
61
}
70
62
}
71
63
72
- const bannerVariant = bannerType ( )
64
+ const alertVariant = alertType ( )
73
65
74
66
return (
75
67
< div
76
- className = { `flex w-full flex-col items-start justify-between gap-4 rounded-md ${ bannerVariant . backgroundColor } px-3 py-3 text-f1-foreground ring-1 ring-inset ring-f1-border-secondary sm:flex-row sm:items-center sm:px-4` }
68
+ className = { `flex w-full flex-col items-start justify-between gap-4 rounded-md ${ alertVariant . backgroundColor } px-3 py-3 text-f1-foreground ring-1 ring-inset ring-f1-border-secondary sm:flex-row sm:items-center sm:px-4` }
77
69
>
78
70
< div className = "flex flex-row items-center justify-between gap-16" >
79
71
< div className = "flex flex-row gap-4" >
80
- < AlertAvatar type = { bannerVariant . alertType } />
72
+ < AlertAvatar type = { alertVariant . alertType } />
81
73
< div className = "flex flex-col gap-2" >
82
- < h3 className = { `${ bannerVariant . fontColor } ` } > { title } </ h3 >
74
+ < h3 className = { `${ alertVariant . fontColor } ` } > { title } </ h3 >
83
75
< p className = "text-base text-f1-foreground" > { description } </ p >
84
76
</ div >
85
77
</ div >
@@ -92,7 +84,7 @@ export const Banner = ({
92
84
/>
93
85
< Button
94
86
label = { buttonPrimaryLabel }
95
- variant = { bannerVariant . buttonType }
87
+ variant = { alertVariant . buttonType }
96
88
onClick = { onRequestClick }
97
89
/>
98
90
</ div >
0 commit comments