tianji/src/client/components/TipIcon.tsx

23 lines
583 B
TypeScript
Raw Normal View History

2024-03-25 13:53:43 +00:00
import React from 'react';
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip';
import { LuHelpCircle } from 'react-icons/lu';
interface TipIconProps {
className?: string;
content: React.ReactNode;
}
export const TipIcon: React.FC<TipIconProps> = React.memo((props) => {
const { className, content } = props;
return (
<Tooltip>
<TooltipTrigger>
<LuHelpCircle className={className} />
</TooltipTrigger>
<TooltipContent className="max-w-xl">{content}</TooltipContent>
</Tooltip>
);
});
TipIcon.displayName = 'TipIcon';