import { EllipsisOutlined } from '@ant-design/icons'; import { Divider, DropDownProps, Dropdown, Tooltip, Typography } from 'antd'; import cls from 'classnames'; import { t } from 'i18next'; import Image from 'next/image'; import React from 'react'; import AppDefaultIcon from '../AppDefaultIcon'; import './style.css'; const BlurredCard: React.FC<{ RightTop?: React.ReactNode; Tags?: React.ReactNode; LeftBottom?: React.ReactNode; RightBottom?: React.ReactNode; rightTopHover?: boolean; name: string; description: string | React.ReactNode; logo?: string; onClick?: () => void; className?: string; scene?: string; code?: string; }> = ({ RightTop, Tags, LeftBottom, RightBottom, onClick, rightTopHover = true, logo, name, description, className, scene, code, }) => { if (typeof description === 'string') { description = (

{description}

); } return (
{scene ? ( ) : ( logo && ( {name} ) )}
{/** 先简单判断下 */} {name.length > 6 ? ( {name} ) : ( {name} )}
{ e.stopPropagation(); }} > {RightTop}
{description}
{Tags}
{LeftBottom}
{RightBottom}
{code && ( <> {code} )}
); }; const ChatButton: React.FC<{ onClick?: () => void; Icon?: React.ReactNode | string; text?: string; }> = ({ onClick, Icon = '/pictures/card_chat.png', text = t('start_chat') }) => { if (typeof Icon === 'string') { Icon = {Icon; } return (
{ e.stopPropagation(); onClick && onClick(); }} > {Icon} {text}
); }; const InnerDropdown: React.FC<{ menu: DropDownProps['menu'] }> = ({ menu }) => { return ( node.parentNode as HTMLElement} placement='bottomRight' autoAdjustOverflow={false} > ); }; export { ChatButton, InnerDropdown }; export default BlurredCard;