import { MouseEvent, ReactNode } from 'react' import { Space, Avatar, Typography, Badge, AvatarProps } from 'antd' import IonIcon from '@sentre/antd-ionicon' import { useAppName } from 'hooks/useAppName' import configs from 'configs' import './index.os.less' const { register: { devAppId }, } = configs export type AppAvatarProps = { appId: string avatarProps: AvatarProps } export const AppAvatar = ({ appId, avatarProps }: AppAvatarProps) => { return appId === devAppId ? ( ) : ( ) } export type RawAppIconProps = { appId: string size?: number onClick?: (e: MouseEvent) => void name?: boolean direction?: 'vertical' | 'horizontal' children?: ReactNode src: ReactNode } export const RawVerticalAppIcon = ({ src, appId, onClick = () => {}, size = 64, name = true, }: RawAppIconProps) => { const getAppName = useAppName() return ( {name ? ( {getAppName(appId)} ) : null} ) } export const RawHorizontalAppIcon = ({ src, appId, onClick = () => {}, size = 32, name = true, }: RawAppIconProps) => { const getAppName = useAppName() return ( {name ? {getAppName(appId)} : null} ) } const RawAppIcon = ({ direction = 'vertical', ...rest }: RawAppIconProps) => { if (direction === 'vertical') return return } export default RawAppIcon