Skip to content

Commit 5810836

Browse files
committed
Refactor TooltipContent props to make icon optional
1 parent e726dc8 commit 5810836

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/scripts/Tabs.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ const TabMenu: FC<TabMenuProps> = (props) => {
102102
/**
103103
*
104104
*/
105-
const TooltipContent = (props: { children: ReactNode; icon: string }) => {
106-
const { children, icon } = props;
105+
const TooltipContent = (props: { children: ReactNode; icon?: string }) => {
106+
const { children, icon = 'info' } = props;
107107
const [isHideTooltip, setIsHideTooltip] = useState(true);
108108
const popoverRef = useRef<HTMLDivElement>(null);
109109
const tooltipToggle = useCallback(() => {
@@ -174,14 +174,7 @@ export type TabItemProps<RendererProps extends TabItemRendererProps> = {
174174
const TabItem = <RendererProps extends TabItemRendererProps>(
175175
props: TabItemProps<RendererProps>
176176
) => {
177-
const {
178-
title,
179-
eventKey,
180-
menu,
181-
menuIcon,
182-
tooltip,
183-
tooltipIcon = 'info',
184-
} = props;
177+
const { title, eventKey, menu, menuIcon, tooltip, tooltipIcon } = props;
185178
const { type, activeTabRef } = useContext(TabsContext);
186179
const activeKey = useContext(TabsActiveKeyContext);
187180
const { onTabClick, onTabKeyDown } = useContext(TabsHandlersContext);

0 commit comments

Comments
 (0)