1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

fix(be-teaser): mute styles [EE-6035] (#10349)

This commit is contained in:
Ali 2023-09-24 19:56:09 +01:00 committed by GitHub
parent ffac83864d
commit 13c48ab961
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 604 additions and 616 deletions

View file

@ -1,14 +1,26 @@
import { HelpCircle } from 'lucide-react';
import { ReactNode, useMemo } from 'react';
import sanitize from 'sanitize-html';
import clsx from 'clsx';
import { TooltipWithChildren, Position } from '../TooltipWithChildren';
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
const sizeClasses: Record<Size, string> = {
xs: 'text-xs',
sm: 'text-sm',
md: 'text-base',
lg: 'text-lg',
xl: 'text-xl',
};
export interface Props {
position?: Position;
message: ReactNode;
className?: string;
setHtmlMessage?: boolean;
size?: Size;
}
export function Tooltip({
@ -16,6 +28,7 @@ export function Tooltip({
position = 'bottom',
className,
setHtmlMessage,
size = 'md',
}: Props) {
// allow angular views to set html messages for the tooltip
const htmlMessage = useMemo(() => {
@ -27,14 +40,14 @@ export function Tooltip({
}, [setHtmlMessage, message]);
return (
<TooltipWithChildren
message={htmlMessage || message}
position={position}
className={className}
>
<span className="inline-flex text-base">
<HelpCircle className="lucide ml-1" aria-hidden="true" />
</span>
</TooltipWithChildren>
<span className={clsx('ml-1 inline-flex items-center', sizeClasses[size])}>
<TooltipWithChildren
message={htmlMessage || message}
position={position}
className={className}
>
<HelpCircle className="lucide" aria-hidden="true" />
</TooltipWithChildren>
</span>
);
}