import React from 'react' import { InformationCircleIcon, } from '@heroicons/react/24/outline' import Tooltip from '../base/tooltip' import AppIcon from '../base/app-icon' const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_' export function randomString(length: number) { let result = '' for (let i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)] return result } export type IAppBasicProps = { iconType?: 'app' | 'api' | 'dataset' | 'webapp' | 'notion' icon?: string icon_background?: string name: string type: string | React.ReactNode hoverTip?: string textStyle?: { main?: string; extra?: string } isExtraInLine?: boolean } const ApiSvg = const DatasetSvg = const WebappSvg = const NotionSvg = const ICON_MAP = { app: , api: , dataset: , webapp: , notion: , } export default function AppBasic({ icon, icon_background, name, type, hoverTip, textStyle, iconType = 'app', isExtraInLine }: IAppBasicProps) { return (
{icon && icon_background && iconType === 'app' && (
)} {iconType !== 'app' &&
{ICON_MAP[iconType]}
}
{name} {hoverTip && }
{type}
) }