Skip to content

Commit a5bde05

Browse files
committed
fix
1 parent 488d486 commit a5bde05

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/components/Ui/Infobox/Infobox.module.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
88
transform: translateY(-2px);
99
color: #fff;
10-
font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
1110
}
1211

1312
.icon {
1413
margin-right: 1rem;
15-
font-size: 1.5rem;
14+
font-size: 4.5rem;
1615
flex-shrink: 0;
1716
}
1817

@@ -55,3 +54,7 @@
5554
.variant-danger {
5655
background: linear-gradient(135deg, #e53935, #e35d5b);
5756
}
57+
58+
.content > *:not(:last-child) {
59+
margin-bottom: 1rem;
60+
}

src/components/Ui/Infobox/Infobox.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ interface LabelProps {
1414
icon?: string;
1515
}
1616

17+
const variantIcons = {
18+
normal: 'message-information',
19+
success: 'message-success',
20+
warning: 'message-warning',
21+
danger: 'message-error',
22+
};
23+
1724
export const Infobox: React.FC<LabelProps> = ({
1825
id,
1926
size = 'md', // Default to medium size
@@ -38,9 +45,11 @@ export const Infobox: React.FC<LabelProps> = ({
3845
className,
3946
);
4047

48+
const iconName = icon || variantIcons[variant];
49+
4150
return (
4251
<div className={infoboxClasses} id={id}>
43-
{icon && <Icon name={icon} className={styles.icon} />}
52+
{iconName && <Icon name={iconName} className={styles.icon} />}
4453
<div className={styles.content}>{children}</div>
4554
</div>
4655
);

0 commit comments

Comments
 (0)