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

fix(gitoptions): git app edit ui tweaks [EE-4584] (#8159)

This commit is contained in:
Ali 2022-12-09 10:41:11 +13:00 committed by GitHub
parent eba5879ec8
commit 563ead85cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 66 additions and 24 deletions

View file

@ -1,4 +1,6 @@
import { HelpCircle } from 'lucide-react';
import { useMemo } from 'react';
import sanitize from 'sanitize-html';
import { TooltipWithChildren, Position } from '../TooltipWithChildren';
@ -6,12 +8,27 @@ export interface Props {
position?: Position;
message: string;
className?: string;
setHtmlMessage?: boolean;
}
export function Tooltip({ message, position = 'bottom', className }: Props) {
export function Tooltip({
message,
position = 'bottom',
className,
setHtmlMessage,
}: Props) {
// allow angular views to set html messages for the tooltip
const htmlMessage = useMemo(() => {
if (setHtmlMessage) {
// eslint-disable-next-line react/no-danger
return <div dangerouslySetInnerHTML={{ __html: sanitize(message) }} />;
}
return null;
}, [setHtmlMessage, message]);
return (
<TooltipWithChildren
message={message}
message={htmlMessage || message}
position={position}
className={className}
>