import React from 'react' import { useTranslation } from 'react-i18next' import AppIcon from '../base/app-icon' import Tooltip from '@/app/components/base/tooltip' export type IAppBasicProps = { iconType?: 'app' | 'api' | 'dataset' | 'webapp' | 'notion' icon?: string icon_background?: string | null isExternal?: boolean name: string type: string | React.ReactNode hoverTip?: string textStyle?: { main?: string; extra?: string } isExtraInLine?: boolean mode?: string } const ApiSvg = const DatasetSvg = const WebappSvg = const NotionSvg = const ICON_MAP = { app: , api: , dataset: , webapp: , notion: , } export default function AppBasic({ icon, icon_background, name, isExternal, type, hoverTip, textStyle, mode = 'expand', iconType = 'app' }: IAppBasicProps) { const { t } = useTranslation() return (
{icon && icon_background && iconType === 'app' && (
)} {iconType !== 'app' &&
{ICON_MAP[iconType]}
} {mode === 'expand' &&
{name} {hoverTip && {hoverTip}
} popupClassName='ml-1' triggerClassName='w-4 h-4 ml-1' position='top' /> }
{type}
{isExternal ? t('dataset.externalTag') : ''}
} ) }