tianji/src/client/components/TipIcon.tsx

23 lines
597 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 type="button">
2024-03-25 13:53:43 +00:00
<LuHelpCircle className={className} />
</TooltipTrigger>
<TooltipContent className="max-w-xl">{content}</TooltipContent>
</Tooltip>
);
});
TipIcon.displayName = 'TipIcon';