1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 14:29:40 +02:00
portainer/app/react/components/Tip/TextTip/TextTip.tsx
2022-07-27 10:47:38 -03:00

39 lines
714 B
TypeScript

import { PropsWithChildren } from 'react';
import clsx from 'clsx';
import { Icon } from '@@/Icon';
type Color = 'orange' | 'blue';
export interface Props {
color?: Color;
}
export function TextTip({
color = 'orange',
children,
}: PropsWithChildren<Props>) {
let iconClass: string;
switch (color) {
case 'blue':
iconClass = 'icon-primary';
break;
case 'orange':
iconClass = 'icon-warning';
break;
default:
iconClass = 'icon-warning';
}
return (
<p className="text-muted small vertical-center">
<Icon
icon="alert-circle"
feather
className={clsx(`${iconClass}`, 'space-right')}
/>
{children}
</p>
);
}