import { Badge, Typography } from 'antd'; import clsx from 'clsx'; import React from 'react'; import { useLocation } from 'react-router'; import { Link } from 'react-router-dom'; export const GroupPanelItem: React.FC<{ name: string; icon: React.ReactNode; to: string; badge?: boolean; }> = React.memo((props) => { const { icon, name, to, badge } = props; const location = useLocation(); const isActive = location.pathname.startsWith(to); return (
{icon}
{name} {badge === true ? ( ) : ( )}
); }); GroupPanelItem.displayName = 'GroupPanelItem';