From d39584fc269ede123bd479858c0cf4c53f9d523f Mon Sep 17 00:00:00 2001 From: one Date: Sun, 11 May 2025 02:46:34 +0800 Subject: [PATCH] revert: customtag tooltip delay (#5856) --- src/renderer/src/components/CustomTag.tsx | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/renderer/src/components/CustomTag.tsx b/src/renderer/src/components/CustomTag.tsx index d16b29c732..76334ae6cb 100644 --- a/src/renderer/src/components/CustomTag.tsx +++ b/src/renderer/src/components/CustomTag.tsx @@ -1,6 +1,6 @@ import { CloseOutlined } from '@ant-design/icons' import { Tooltip } from 'antd' -import { FC, memo, useEffect, useMemo, useState } from 'react' +import { FC, memo } from 'react' import styled from 'styled-components' interface CustomTagProps { @@ -14,29 +14,13 @@ interface CustomTagProps { } const CustomTag: FC = ({ children, icon, color, size = 12, tooltip, closable = false, onClose }) => { - const [showTooltip, setShowTooltip] = useState(false) - - useEffect(() => { - const timer = setTimeout(() => setShowTooltip(true), 300) - return () => clearTimeout(timer) - }, []) - - const tagContent = useMemo( - () => ( + return ( + {icon && icon} {children} {closable && } - ), - [children, color, closable, icon, onClose, size] - ) - - return tooltip && showTooltip ? ( - - {tagContent} - ) : ( - tagContent ) }