Skip to content

Commit 812e9a5

Browse files
committed
Update Infobox.tsx
1 parent a5bde05 commit 812e9a5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/Ui/Infobox/Infobox.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import cx from 'clsx';
33
import { Icon } from '@ui5/webcomponents-react';
44

55
import styles from './Infobox.module.css';
6+
import { useTheme } from '../../../hooks/useTheme';
67

78
interface LabelProps {
89
id?: string;
@@ -23,13 +24,14 @@ const variantIcons = {
2324

2425
export const Infobox: React.FC<LabelProps> = ({
2526
id,
26-
size = 'md', // Default to medium size
27-
variant = 'normal', // Default to normal variant
27+
size = 'md',
28+
variant = 'normal',
2829
children,
2930
fullWidth = false,
3031
className,
3132
icon,
3233
}) => {
34+
const { isDarkTheme } = useTheme();
3335
const infoboxClasses = cx(
3436
styles.infobox,
3537
{
@@ -41,6 +43,7 @@ export const Infobox: React.FC<LabelProps> = ({
4143
[styles['variant-warning']]: variant === 'warning',
4244
[styles['variant-danger']]: variant === 'danger',
4345
[styles['full-width']]: fullWidth,
46+
[styles['dark-mode']]: isDarkTheme,
4447
},
4548
className,
4649
);

0 commit comments

Comments
 (0)