import React from 'react' import { useTranslation } from 'react-i18next' import { RiBookReadLine } from '@remixicon/react' import cn from '@/utils/classnames' import { ReadmeShowType, useReadmePanelStore } from './store' import { BUILTIN_TOOLS_ARRAY } from './constants' import type { PluginDetail } from '../types' export const ReadmeEntrance = ({ pluginDetail, showType = ReadmeShowType.drawer, className, showShortTip = false, }: { pluginDetail: PluginDetail showType?: ReadmeShowType className?: string showShortTip?: boolean }) => { const { t } = useTranslation() const { setCurrentPluginDetail } = useReadmePanelStore() const handleReadmeClick = () => { if (pluginDetail) setCurrentPluginDetail(pluginDetail, showType) } if (!pluginDetail || !pluginDetail?.plugin_unique_identifier || BUILTIN_TOOLS_ARRAY.includes(pluginDetail.id)) return null return (
{!showShortTip &&
}
) }